Closed twiden closed 11 months ago
Is there a way to push metrics to a Prometheus Pushgateway that has basic auth enabled?
(Enabling basic auth in Pushgateway protects all HTTP endpoints including POST metrics)
We would need to set a connection factory: pg.setConnectionFactory(new BasicAuthHttpConnectionFactory("user", "pass")); in here.
pg.setConnectionFactory(new BasicAuthHttpConnectionFactory("user", "pass"));
Example: https://github.com/prometheus/client_java/blob/main/integration_tests/it_pushgateway/src/main/java/io/prometheus/client/it/pushgateway/ExampleBatchJob.java#L32C13-L32C91
Is there a way to push metrics to a Prometheus Pushgateway that has basic auth enabled?
(Enabling basic auth in Pushgateway protects all HTTP endpoints including POST metrics)