splunk_modinput_prometheus
splunk_modinput_prometheus copied to clipboard
api config
I'm trying to connect splunk via this mod_input to our Prometheus server.
The Prometheus api is as below and works fine:
curl https://usr:pwd@hostname/prometheus/ciams/api/v1/label/job/values
However the config in the inputs.conf file should be in a different format according to the examples. But all I try doesn't work, as there is nothing listening on /metrics example:
[prometheus://example] URI = https://usr:pwd@hostname:443/metrics index = prometheus sourcetype = prometheus:metric interval = 30 disabled = 0
How can I pull the metrics? Should something be reconfigured on Prometheus?
The [prometheus://] input can connect to two endpoint types:
- A metrics exporter. This is not on your Prometheus server, but a metrics exporter that a Prometheus server would typically poll itself. Splunk takes on the roll of polling the exporter in this case. This is what is typically on the /metrics endpoint.
- The Prometheus server's /federate endpoint. This is probably what you are looking for from your description. Please see the readme.md for instructions on this, as you will need to specify a match filter when connecting to the federate endpoint.
https://github.com/lukemonahan/splunk_modinput_prometheus#federate-server-1