All Apps and Add-ons

Question on credentials on the static prometheus exporter

vsingla1
Communicator

I am trying to ingest metrics into splunk from a static prometheus exporter. My prometheus exporter is having credentials (username:passsword) to access the endpoint. Where/how do I supply the username:password in this modular add-on? Can you guide me here?

0 Karma
1 Solution

luke_monahan
Path Finder

We haven't yet written any functionality for properly doing HTTP basic auth. If you can please raise a feature request on Github (https://github.com/lukemonahan/splunk_modinput_prometheus).

You could try specifying it in your url, e.g.: https://user:password@host/metrics

Or similar to this.I haven't tested this use case, however, so it may not work.

I will typically make the "host" the polled server in this case, however it really depends on what suits you best.

insecureSkipVerify setting should be correct in this case, if the SSL certificate is not properly signed and trusted.

View solution in original post

vsingla1
Communicator

Thanks for your reply. https://user:password@host/metrics --> this worked just fine.

0 Karma

luke_monahan
Path Finder

We haven't yet written any functionality for properly doing HTTP basic auth. If you can please raise a feature request on Github (https://github.com/lukemonahan/splunk_modinput_prometheus).

You could try specifying it in your url, e.g.: https://user:password@host/metrics

Or similar to this.I haven't tested this use case, however, so it may not work.

I will typically make the "host" the polled server in this case, however it really depends on what suits you best.

insecureSkipVerify setting should be correct in this case, if the SSL certificate is not properly signed and trusted.

vsingla1
Communicator

Another question I have:
in inputs.conf, what should be the value of "host". Is the host my prometheus endpoint (to which I am polling) OR is the host my splunk server/heavy forwarder name?

0 Karma

vsingla1
Communicator

Here is my apps/modinput_prometheus/local/inputs.conf

[prometheus://gralog]
URI = https://graylog-server/api/plugins/org.graylog.plugins.metrics.prometheus/metrics
index = prometheus
sourcetype = prometheus:metric
interval = 30
disabled = 0
insecureSkipVerify = 1
host = graylog-server

the prometheus endpoint is https, so I have configured insecureSkipVerify=1. Please let me know if this is not the right config.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...