Skip to content

fix: correct label mapping for collection metrics#134

Merged
d0ugal merged 2 commits intomainfrom
fix-metric-label-order
Oct 27, 2025
Merged

fix: correct label mapping for collection metrics#134
d0ugal merged 2 commits intomainfrom
fix-metric-label-order

Conversation

@d0ugal
Copy link
Copy Markdown
Owner

@d0ugal d0ugal commented Oct 27, 2025

Fix label mapping mismatch where collection metrics expected 'repo'
label but were receiving 'name' label. This was causing panics:

panic: label name "repo" missing in label map

The metrics definitions in ghcr_registry.go specify:

  • CollectionFailedCounter: []string{"repo", "interval"}
  • CollectionSuccessCounter: []string{"repo", "interval"}
  • CollectionIntervalGauge: []string{"repo", "interval"}
  • CollectionDurationGauge: []string{"repo", "interval"}
  • CollectionTimestampGauge: []string{"repo", "interval"}

But the collector was using 'name' instead of 'repo' in the labels.

This highlights the need for better integration tests that would
catch label mapping mismatches before deployment.

Changes

  • Fixed all collection metric label mappings from "name" to "repo"
  • Maintained existing functionality while ensuring correct label names

Testing

  • Build tested successfully
  • Ready for deployment testing

Fix label mapping mismatch where collection metrics expected 'repo'
label but were receiving 'name' label. This was causing panics:

panic: label name "repo" missing in label map

The metrics definitions in ghcr_registry.go specify:
- CollectionFailedCounter: []string{"repo", "interval"}
- CollectionSuccessCounter: []string{"repo", "interval"}
- CollectionIntervalGauge: []string{"repo", "interval"}
- CollectionDurationGauge: []string{"repo", "interval"}
- CollectionTimestampGauge: []string{"repo", "interval"}

But the collector was using 'name' instead of 'repo' in the labels.

This highlights the need for better integration tests that would
catch label mapping mismatches before deployment.
@d0ugal d0ugal merged commit 31a2c94 into main Oct 27, 2025
8 of 10 checks passed
@d0ugal d0ugal deleted the fix-metric-label-order branch October 27, 2025 20:19
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.

1 participant