Skip to content

fix(chart): authenticate ServiceMonitor via token Secret instead of bearerTokenFile - #197

Merged
Breee merged 2 commits into
mainfrom
fix/servicemonitor-token-secret
Nov 5, 2026
Merged

Breee merged 2 commits into
mainfrom
fix/servicemonitor-token-secret

Conversation

@Breee

@Breee Breee commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Grafana Alloy (and Prometheus Operator setups without arbitrary file access) reject ServiceMonitors using bearerTokenFile, so drop metrics never reached Mimir.

  • Dedicated <release>-metrics-scraper ServiceAccount + token Secret bound to <release>-metrics-reader; ServiceMonitor uses authorization.credentials.
  • TLS is verified against the cert-manager CA (ca.crt) with serverName; no insecureSkipVerify.
  • Breaking: serviceMonitor.enabled + metrics.secureServing now requires certManager.enabled=true; rendering fails otherwise.
  • metrics.secureServing=false scrapes over plain HTTP (previously always https, mismatching the server).

Wachter, Julian added 2 commits November 5, 2026 10:27
…earerTokenFile

Grafana Alloy (and Prometheus Operator setups without arbitrary file
access) reject ServiceMonitors using bearerTokenFile, so drop metrics
were never scraped. Create a dedicated metrics-scraper ServiceAccount
with a token Secret bound to the metrics-reader ClusterRole and reference
it via authorization.credentials. Verify TLS against the cert-manager CA
when enabled, and scrape over plain HTTP when secureServing is off.
Drop the insecureSkipVerify fallback. Without cert-manager the operator
serves an in-memory self-signed certificate that no scraper can verify,
so fail rendering with a clear message instead.
@Breee
Breee merged commit c182138 into main Nov 5, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant