Skip to content

Metric relabeling capability in the helm chart #1971

@mikhailadvani

Description

@mikhailadvani

Describe the solution you'd like

Ability to set further attributes of the servicemonitor resource

What is the added value?

While running in a multi-tenant setup, we can have multiple alertmanagerconfig resources (typically one per namespace) of the kube-prometheus-stack which has an implicit matcher on the namespace label. Given the namespace label in this case is always the namespace of the service monitor resource and the value of the namespace of external secret resource is under the exported_namespace label.

Give us examples of the outcome

Desired endpoints block in servicemonitor spec:

  endpoints:
  - interval: 30s
    port: metrics
    scrapeTimeout: 25s
    honorLabels: true
    metricRelabelings:
    - action: replace
      regex: (.*)
      replacement: $1
      sourceLabels:
      - exported_namespace
      targetLabel: namespace

Observations (Constraints, Context, etc):

Current scenario
Screenshot 2023-02-01 at 10 24 00

Desired scenario
Screenshot 2023-02-01 at 10 34 05

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions