Skip to content

Fix Prometheus Metrics and Grafana dashboard - #54

Merged
netops2devops merged 3 commits into
mainfrom
metrics/dashboard
Aug 13, 2026
Merged

Fix Prometheus Metrics and Grafana dashboard#54
netops2devops merged 3 commits into
mainfrom
metrics/dashboard

Conversation

@netops2devops

Copy link
Copy Markdown
Contributor

Metrics endpoint

  • externalcas/metrics.go: Changed externalCAStatus from a plain Gauge to a GaugeVec with a ca_url label, so the upstream CA URL is carried directly in the time series.
  • externalcas/metrics_test.go: Added two tests covering the new GaugeVec behaviour — UP on 2xx and DOWN on non-2xx, both asserting the ca_url label is set correctly.

Grafana Dashboard

  • contrib/develop/grafana-dashboard.json: Reworked the Health Overview section — External CA panel replaced with a table showing URL + coloured UP/DOWN status; Issuance Success Rate switched to a fixed 24h window; Issued/Revoked totals now read from the persistent KV-backed collector metrics instead of process-reset-sensitive counters; operation rate panels converted from ops/sec to ops/day. Added Issuer column to the All Certificates and Renewal Count inventory tables. Added a new "Certificates Issued in Time Range" panel that filters to certs issued within the dashboard time picker window, showing SAN, Issuer, Serial, and Days Remaining with a row count footer.

- externalcas/metrics.go: Changed externalCAStatus from a plain Gauge to a GaugeVec with a ca_url label, so the upstream CA URL is carried directly
  in the time series.
  - externalcas/metrics_test.go: Added two tests covering the new GaugeVec behaviour — UP on 2xx and DOWN on non-2xx, both asserting the ca_url label
  is set correctly.
  - contrib/develop/grafana-dashboard.json: Reworked the Health Overview section — External CA panel replaced with a table showing URL + coloured
  UP/DOWN status; Issuance Success Rate switched to a fixed 24h window; Issued/Revoked totals now read from the persistent KV-backed collector metrics
  instead of process-reset-sensitive counters; operation rate panels converted from ops/sec to ops/day. Added Issuer column to the All Certificates
  and Renewal Count inventory tables. Added a new "Certificates Issued in Time Range" panel that filters to certs issued within the dashboard time
  picker window, showing SAN, Issuer, Serial, and Days Remaining with a row count footer.

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

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.28%. Comparing base (8396f7e) to head (5e7fda3).

Files with missing lines Patch % Lines
externalcas/metrics.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #54   +/-   ##
=======================================
  Coverage   44.28%   44.28%           
=======================================
  Files           6        6           
  Lines         490      490           
=======================================
  Hits          217      217           
  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.

problems

Signed-off-by: Kapil Agrawal <7047165+netops2devops@users.noreply.github.com>
Signed-off-by: Kapil Agrawal <7047165+netops2devops@users.noreply.github.com>
@netops2devops
netops2devops merged commit 30484d0 into main Aug 13, 2026
7 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