splunk_modinput_prometheus icon indicating copy to clipboard operation
splunk_modinput_prometheus copied to clipboard

api config

Open cdecc opened this issue 3 years ago • 1 comments

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?

cdecc avatar Aug 09 '22 13:08 cdecc

The [prometheus://] input can connect to two endpoint types:

  1. 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.
  2. 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

lmonahanwow avatar Aug 09 '22 23:08 lmonahanwow