Skip to content

[Enhancement][opensearch] Make servicemonitor selector.matchLabels customizable (duplicate metrics through two services) #692

@cinimins

Description

@cinimins

Is your feature request related to a problem? Please describe.
Activating the servicemonitor leads to Prometheus scraping both services, the "normal" service, as well as the headless service leading to duplicates of each metric series (with labels service=opensearch and service=opensearch-headless). With service.labelsHeadless: [prometheus.io/scrape: "true"] I want the servicemonitor to only scrape the headless service. But the Helm chart does not allow me to adjust/expand the servicemonitor configuration spec.endpoints[].selector.matchLabels

Describe the solution you'd like
Allow overwriting the servicemonitor field spec.endpoints[].selector.matchLabels.

Describe alternatives you've considered
Maybe there is a more straight-forward solution or a trick avoid duplicate series. Setting labels to make both services distinguishable was the only approach that came to mind.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestuntriagedIssues that have not yet been triaged

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions