add auth or dissable /metrics endpoint for prometheus client
Asked Answered
C

1

6

I am using Prometheus on OpenShift platform. Authentication is handled by OpenShift for Prometheus and all its sub domains except /metrics endpoint. It bypasses all authentication and shows Prometheus go client metrics plain texted.

Is it possible to somehow force OpenShift authentication on prometheus/metrics endpoint or to disable that endpoint since I don't really need go client metrics?

I know that node_exporters have flags to control certain collectors but I couldn't find it for Prometheus client itself.

Castled answered 20/1, 2020 at 8:35 Comment(0)
T
1

i'm not sure about openshift auth, but you can add basic auth to the '/metrics' endpoint. Alternatively prometheus can also support TLS.

Add the following to the 'scrape_config' section in your prometheus config file (prometheus.yml by default)

basic_auth:
    username: "admin"
    password: "password"

More info can be found in the official prometheus documentation linked here

Twinkle answered 10/2, 2020 at 7:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.