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

Apply additional label to headless Service + ServiceMonitor to avoid duplicate scraping #214

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

frittentheke
Copy link
Contributor

@frittentheke frittentheke commented Jul 22, 2024

Add a common label app.kubernetes.io/component (https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels) with value cluster-discovery to the headless Service and the ServiceMonitor it's ensured metrics are only scraped once.

Using the headless service also makes the most sense, as it has the sole purpose of discovering all Pods making up a qdrant cluster. With publishNotReadyAddresses: true metrics are also collected from non-ready pods, see prometheus-operator/prometheus-operator#5693. This is helpful to also collect metrics from Pods that might never become ready to use them for e.g. alerting and problem analysis

Fixes: #207

…duplicate scraping

Add a common label `app.kubernetes.io/component` ([1]) with value
`cluster-discovery` to the headless Service and the ServiceMonitor it's ensured
metrics are only scraped once.

Using the headless service also makes the most sense, as it has the sole purpose
of discovering all Pods making up a qdrant cluster.
With `publishNotReadyAddresses: true` metrics are also collected from non-ready
pods, see [2]. This is helpful to also collect metrics from Pods that might never
become ready to use them for e.g. alerting and problem analysis

[1] https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels
[2] prometheus-operator/prometheus-operator#5693

Fixes: qdrant#207
@frittentheke
Copy link
Contributor Author

^^ @timvisee

@timvisee
Copy link
Member

timvisee commented Aug 7, 2024

Thanks for the PR. I just got back from holiday so I was not able to catch this earlier.

I'm not familiar with Helm enough to properly review this, so I'll ask some others to take a look.

@bashofmann bashofmann merged commit c9e613a into qdrant:main Aug 12, 2024
1 check 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.

[Bug] ServiceMonitor targets both qdrant AND qdrant-headless services
3 participants