Skip to content

Fix metrics mongodb_connPoolStats_replicaSets_{replName})_key1_key12 collect failed #1130

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

naughtyGitCat
Copy link
Contributor


Below we provide a basic checklist of things that would make it a good PR:

  • Make sure to sign the CLA (Contributor License Agreement).
  • Make sure all tests pass.
  • Keep current with the target branch and fix conflicts if necessary.
  • Update jira ticket description if necessary.
  • Attach screenshots and/or console output to the jira ticket to confirm new behavior, if applicable.
  • Leave notes to the reviewers if you need to focus their attention on something specific.

Once all checks pass and the code is ready for review, please add pmm-review-exporters team as the reviewer. That would assign people from the review team automatically. Report any issues on our Forum.

…ame/configReplSetName}_{childKey}_{grandChildKey} raise error with '...was collected before with the same name and label values...'
@naughtyGitCat naughtyGitCat requested a review from a team as a code owner August 4, 2025 08:16
@naughtyGitCat naughtyGitCat requested review from BupycHuk and JiriCtvrtka and removed request for a team August 4, 2025 08:16
Copy link

codecov bot commented Aug 4, 2025

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.04%. Comparing base (dc46ed5) to head (15d9146).
⚠️ Report is 121 commits behind head on main.

Files with missing lines Patch % Lines
exporter/metrics.go 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1130      +/-   ##
==========================================
- Coverage   70.88%   65.04%   -5.85%     
==========================================
  Files          28       29       +1     
  Lines        3569     3095     -474     
==========================================
- Hits         2530     2013     -517     
- Misses        904      941      +37     
- Partials      135      141       +6     
Flag Coverage Δ
agent 65.04% <0.00%> (-5.85%) ⬇️

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.

@naughtyGitCat naughtyGitCat changed the title fix metrics named by mongodb_connPoolStats_replicaSets_{shardReplSetN… Fix metrics mongodb_connPoolStats_replicaSets_{replName})_key1_key12 collect failed Aug 5, 2025
@@ -401,6 +401,9 @@ func processSlice(prefix string, v []interface{}, commonLabels map[string]string
if host, ok := s["host"].(string); ok {
labels["member_idx"] = host
}
if addr, ok := s["addr"].(string); ok {
labels["member_addr"] = addr
Copy link
Member

Choose a reason for hiding this comment

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

wouldn't it be better to reuse member_idx?

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