Skip to content

Fix duplicate label set error in certMetaCollector for failed issuances - #53

Merged
netops2devops merged 1 commit into
mainfrom
fix/metrics/failed-records-collector
Aug 13, 2026
Merged

Fix duplicate label set error in certMetaCollector for failed issuances#53
netops2devops merged 1 commit into
mainfrom
fix/metrics/failed-records-collector

Conversation

@netops2devops

Copy link
Copy Markdown
Contributor

This MR issues the fix for a bug in metrics endpoint collector that keeps track of failed certs in metrics.db and thus starting acme-proxy may leads to the following error when querying the metrics endpoint.

note - The acme-proxy server started just fine and was issuing certs.

curl http://acmeproxy-dev.example.com:9234/metrics
An error has occurred while serving metrics:

56 error(s) occurred:
* collected metric "externalcas_certificate_info" { label:{name:"common_name" value:"acmeproxy-dev.example.com"} label:{name:"issuer" value:""} label:{name:"sans" value:"acmeproxy-dev.example.com"} label:{name:"serial" value:""} label:{name:"status" value:"failure"} gauge:{value:1}} was collected before with the same name and label values
* collected metric "externalcas_certificate_signing_duration_seconds" { label:{name:"common_name" value:"acmeproxy-dev.example.com"} label:{name:"serial" value:""} label:{name:"status" value:"failure"} gauge:{value:30.938804371}} was collected before with the same name and label values

  Failure records have no serial or issuer, so multiple failures for the
  same CN/SAN produce identical label sets in Collect(), causing Prometheus
  to abort the scrape. Skip failure records in the collector — they are
  already counted by externalcas_certificates_issued_total{status="failure"}.

Signed-off-by: Kapil Agrawal <7047165+netops2devops@users.noreply.github.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.28%. Comparing base (5d875a0) to head (3480389).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #53      +/-   ##
==========================================
+ Coverage   44.17%   44.28%   +0.11%     
==========================================
  Files           6        6              
  Lines         489      490       +1     
==========================================
+ Hits          216      217       +1     
  Misses        262      262              
  Partials       11       11              

☔ View full report in Codecov by Harness.
📢 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.

@netops2devops
netops2devops merged commit 8396f7e into main Aug 13, 2026
7 checks passed
@netops2devops
netops2devops deleted the fix/metrics/failed-records-collector branch August 19, 2026 21:15
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