Thanos components not monitored in Prometheus (401 error code)

Summary

serviceMonitor for the Thanos components doesn't specify basicAuth credentials

Steps to reproduce

Present on a fresh installation

What is the current bug behavior?

Prometheus shows "server returned HTTP status 401 Unauthorized"

What is the expected correct behavior?

image

Relevant logs and/or screenshots

image

Possible fixes

units:
  thanos:
    helmrelease_spec:
      helm_secret_values:
        metrics:
          serviceMonitor:
            extraParameters:
              basicAuth:
                password:
                  name: thanos-basic-auth
                  key: password
                username:
                  name: thanos-basic-auth
                  key: username

A secret thanos-basic-auth must be present in the thanos namespace

apiVersion: v1
data:
  username: thanos-user
  password: '{{ .Values._internal.thanos_password }}'
kind: Secret
metadata:
  namespace: thanos
  name: thanos-basic-auth
type: Opaque
Edited May 20, 2024 by Alin H
Assignee Loading
Time tracking Loading