Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(operator): Fix duplicate operator metrics due to ServiceMonitor selector #12216

Merged
merged 3 commits into from Mar 14, 2024

Conversation

xperimental
Copy link
Collaborator

@xperimental xperimental commented Mar 14, 2024

What this PR does / why we need it:

During installation of Loki Operator it creates multiple services pointing to the operator used for different purposes. The ServiceMonitor used for getting metrics from the operator contains a selector that currently matches more than one of these services. This causes Prometheus to generate multiple targets for the same operator instance, leading to duplicate metrics.

This PR fixes this issue by adding an explicit "metrics label" to one of the services and updating the ServiceMonitor to just match that specific service.

Which issue(s) this PR fixes:

LOG-5212

Special notes for your reviewer:

Checklist

@xperimental xperimental self-assigned this Mar 14, 2024
@xperimental xperimental requested review from periklis and a team as code owners March 14, 2024 14:22
@xperimental xperimental changed the title fix(operator): Add explicit label to metrics service fix(operator): Fix duplicate operator metrics due to ServiceMonitor selector Mar 14, 2024
@periklis periklis enabled auto-merge (squash) March 14, 2024 14:41
@periklis periklis merged commit 88393ed into grafana:main Mar 14, 2024
18 checks passed
@xperimental xperimental deleted the fix-multi-scrape branch March 14, 2024 15:54
periklis added a commit to periklis/loki that referenced this pull request Mar 14, 2024
…elector (grafana#12216)

Co-authored-by: Periklis Tsirakidis <periklis@redhat.com>
periklis added a commit to periklis/loki that referenced this pull request Mar 14, 2024
…elector (grafana#12216)

Co-authored-by: Periklis Tsirakidis <periklis@redhat.com>
periklis added a commit to periklis/loki that referenced this pull request Mar 14, 2024
…elector (grafana#12216)

Co-authored-by: Periklis Tsirakidis <periklis@redhat.com>
openshift-merge-bot bot added a commit to openshift/loki that referenced this pull request Mar 15, 2024
openshift-merge-bot bot added a commit to openshift/loki that referenced this pull request Mar 15, 2024
openshift-merge-bot bot added a commit to openshift/loki that referenced this pull request Mar 15, 2024
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
…elector (grafana#12216)

Co-authored-by: Periklis Tsirakidis <periklis@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants