Skip to content

Conversation

@tviaud
Copy link
Contributor

@tviaud tviaud commented Oct 15, 2025

Is this a new chart

No

What this PR does / why we need it:

This pull request adds support for customising which kube-state-metrics instance is targeted by the Prometheus receiver in the otel deployment. This is useful for clusters running multiple kube-state-metrics instances, allowing users to specify a label selector to avoid scraping duplicate metrics.

This is mostly mirroring what's done for the ksm component in the newrelic-infrastructure chart: https://github.com/newrelic/nri-kubernetes/blob/main/charts/newrelic-infrastructure/values.yaml#L255.

This would be useful in migration cases to keep nri-bundle and nr-k8s-otel-collector up at the same time for example.

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

  • fixes #

Special notes for your reviewer:

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • Chart Version bumped
  • Variables are documented in the README.md
  • Title of the PR starts with chart name (e.g. [mychartname])

Release Notes to Publish (nr-k8s-otel-collector)

If this PR contains changes in nr-k8s-otel-collector, please complete the following section. All other charts should ignore this section.

🚀 What's Changed

  • Added configurable label selector for kube-state-metrics discovery via receivers.prometheus.ksmSelector to prevent duplicate metric scraping when running multiple kube-state-metrics instances in the same cluster (e.g., during migration from nri-bundle to nr-k8s-otel-collector).

@tviaud tviaud requested a review from a team as a code owner October 15, 2025 19:21
@dbudziwojskiNR
Copy link
Contributor

@tviaud, thanks for the PR! This looks great. Just left a few comments and we can work to get this merged. Thank you!

dbudziwojskiNR
dbudziwojskiNR previously approved these changes Nov 3, 2025
@dbudziwojskiNR dbudziwojskiNR merged commit 1066784 into newrelic:master Nov 5, 2025
13 checks 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.

2 participants