Skip to content

fix: fix metric duplication and remove obsolete r label - #62

Merged
raffis merged 2 commits into
raffis:mainfrom
pascal-hofmann:fix-metrics-duplication
Aug 12, 2025
Merged

raffis merged 2 commits into
raffis:mainfrom
pascal-hofmann:fix-metrics-duplication

Conversation

@pascal-hofmann

Copy link
Copy Markdown
Contributor

Hi @raffis,
I noticed that there are a lot of metrics with r!=repository. This stems from the fact, that the Pusher never unregisters the collectors that are added to it. So pushing metrics for a new repository will also include all metrics from all previous repositories.

As the Pusher does not have a way to unregistered collectors, this change creates a new Pusher per repository.

I also removed the r label, as it always is equal to repository.

I tested and verified my changes with a local prometheus/pushgateway setup.

Would be great to have this merged and released soon.

Note: This PR recreates #60 based upon a different source branch.

@raffis raffis left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

lgtm, thanks for the pr.

@raffis
raffis merged commit f29064e into raffis:main Aug 12, 2025
@pascal-hofmann
pascal-hofmann deleted the fix-metrics-duplication branch August 26, 2025 18:49
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