Skip to content

exporter: rename scrapeall instance label#1286

Open
SAY-5 wants to merge 8 commits into
percona:mainfrom
SAY-5:fix-scrapeall-mongo-instance-label
Open

exporter: rename scrapeall instance label#1286
SAY-5 wants to merge 8 commits into
percona:mainfrom
SAY-5:fix-scrapeall-mongo-instance-label

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 15, 2026

Copy link
Copy Markdown

Fixes #1143.

currently adds an label to each target's metrics, which Prometheus rewrites to its reserved label. That hides the MongoDB target identity and makes the label unusable in PromQL.

This change renames the label to , updates the README example, and adds a small unit test for the label helper.

Validation:

  • ok github.com/percona/mongodb_exporter/exporter (cached)
  • ok github.com/percona/mongodb_exporter (cached)
    ok github.com/percona/mongodb_exporter/exporter (cached) [no tests to run]
    ok github.com/percona/mongodb_exporter/exporter/dsn_fix (cached) [no tests to run]
    ? github.com/percona/mongodb_exporter/internal/proto [no test files]
    ok github.com/percona/mongodb_exporter/internal/tu (cached) [no tests to run]
    ? github.com/percona/mongodb_exporter/internal/util [no test files]

@SAY-5
SAY-5 requested a review from a team as a code owner May 15, 2026 05:47
@SAY-5
SAY-5 requested review from 4nte and JiriCtvrtka and removed request for a team May 15, 2026 05:47
@codecov

codecov Bot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.33%. Comparing base (dc46ed5) to head (156eabc).
⚠️ Report is 220 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (dc46ed5) and HEAD (156eabc). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (dc46ed5) HEAD (156eabc)
agent 10 6
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1286      +/-   ##
==========================================
- Coverage   70.88%   65.33%   -5.56%     
==========================================
  Files          28       29       +1     
  Lines        3569     2481    -1088     
==========================================
- Hits         2530     1621     -909     
+ Misses        904      715     -189     
- Partials      135      145      +10     
Flag Coverage Δ
agent 65.33% <100.00%> (-5.56%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JiriCtvrtka
JiriCtvrtka requested a review from ademidoff May 18, 2026 07:21
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.

The instance label has a collision with the prometheus hidden label

2 participants