Skip to content

chore: Add relabeling and metricRelabeling to Service Monitor in Karpenter Helm Chart #7794

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

Merged
merged 2 commits into from
May 21, 2025

Conversation

waruwat-dev
Copy link
Contributor

Fixes #N/A

Description
This merge request enhances the ServiceMonitor in the Karpenter Helm Chart by adding support for relabeling and metricRelabeling. This allows users to modify labels and filter metrics before they are scraped by Prometheus.

Motivation
In some cases, users need to adjust labels or refine metrics to align with their existing monitoring setup.
Prometheus provides relabel_configs and metric_relabel_configs to modify or filter metrics dynamically, but the Karpenter Helm Chart currently lacks the ability to configure these options.

Changes Introduced

  • Adds support for configuring relabelings, metricRelabelings in the ServiceMonitor.

How was this change tested?

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@waruwat-dev waruwat-dev requested a review from a team as a code owner February 24, 2025 10:44
@waruwat-dev waruwat-dev requested a review from rschalo February 24, 2025 10:44
Copy link

netlify bot commented Feb 24, 2025

Deploy Preview for karpenter-docs-prod canceled.

Name Link
🔨 Latest commit 1527cd3
🔍 Latest deploy log https://app.netlify.com/sites/karpenter-docs-prod/deploys/67bd35f4190eda00087e0af6

@jonathan-innis jonathan-innis added help-wanted Extra attention is needed and removed help-wanted Extra attention is needed labels Mar 10, 2025
@engedaam
Copy link
Contributor

@waruwat-dev Can you walk me through relabel_configs and metric_relabel_configs work with the Prometheus scraper and an example of how they would be used?

@coveralls
Copy link

coveralls commented Mar 12, 2025

Pull Request Test Coverage Report for Build 15151860817

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 66.844%

Totals Coverage Status
Change from base Build 15125720112: 0.0%
Covered Lines: 6913
Relevant Lines: 10342

💛 - Coveralls

@pjastrzabek
Copy link

Exactly what we need now.

We want to have karpenter metrics, but it's also exposing metrics we do not care about for instance:

karpenter_cloudprovider_instance_type_offering_price_estimate

which is basically AWS pricing inside metrics with almost 5000 data points for each scrape

We have many clusters, we don't need that metrics from each of them (data is the same) and in fact we want to drop it completely.

Second usecase is, by default karpenter metrics do have many labels (more than 30) which is more than some stacks (like mimir) allow for by default. Droping some labels is what we do for some other helm charts after carefull review, but typicall helm charts allow for that. Karpenter one does not.

@jonathan-innis jonathan-innis self-assigned this Apr 17, 2025
Copy link

netlify bot commented May 21, 2025

Deploy Preview for karpenter-docs-prod canceled.

Name Link
🔨 Latest commit d347da0
🔍 Latest deploy log https://app.netlify.com/projects/karpenter-docs-prod/deploys/682d34a93692d00008e1a576

Copy link
Contributor

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@jonathan-innis jonathan-innis enabled auto-merge (squash) May 21, 2025 02:05
@jonathan-innis jonathan-innis merged commit 531fdee into aws:main May 21, 2025
17 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.

6 participants