What is the exact meaning of username and password?
Hello,
I just configured my Java App (Kafka) to publish it's metrics through the Prometheus JMX Exporter. I specified the variables username and password in the config file and passed it to the app using
-javaagent:/opt/jmx_prometheus/jmx_prometheus_javaagent.jar=127.0.0.1:7170:/etc/zookeeper/zookeeper_jmx_prometheus.yml
I thought that I would need to retrieve the metrics using this command:
curl -u user:passwd http://127.0.0.1:7170/metrics
However, I can retrieve the metrics using that, but I also get the metrics when omitting the -u user:passwd part.
Do I miss something?
Any help is appreciated!
Kind regards
Jens
Version of javaagent: 0.12.0
The username and password are used when accessing JMX remotely.
Currently, jmx_exporter does not support authentication to the HTTP endpoint. Work is being done to add the functionality, but I don't know if there is timeline.
Hi,
I am currently using the jmx exporter to push the tomcat metrics on prometheus.
-javaagent:/opt/tomcat/webapps/jmx_prometheus_javaagent-0.17.2.jar=9409:/opt/tomcat/webapps/config.yaml
I want to enable basic authentication for the same. Is the work still in progress for later versions of 0.12.0 ?
Exporter HTTP authentication still needs to be implemented.
I am targeting the feature into the next release.
Btw, after a bit of exploration on the issues, I found a workaround of using the jmx_prometheus_javaagent-0.17.3-SNAPSHOT.jar that you have mentioned in which authentication is working. Here is my config.yml file.
httpServer:
authentication:
enabled: true
algorithm: Basic
username:
password:
But I also need to enable SSL for the same. Can you provide that config if it is working in the SNAPSHOT?
This jar was an example of experimental development work and is NOT support.
You should NOT use this in production.
Understood your point. I am only using this out for testing the metrics I am getting on the Prometheus endpoint. I was just curious to know about the support of basic auth and SSL. This WONT go in production environments.
Just wanted to share that SSL is also working with this minimal config. Thanks for the fix in the SNAPSHOT. Waiting for the released version.
Closing as stale. Please reopen if you would like to continue the discussion.