Skip to content
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

fix: serve metrics correctly when there are multiple listeners #10489

Closed
wants to merge 5 commits into from

Conversation

gammazero
Copy link
Contributor

When there are multiple listeners configured for Addresses.API, serving metrics results in an errors: " was collected before with the same name and label values".

This PR fixes this by maintaining a global map of metrics handlers, and only creating and reginstering them once. The same metrics handlers are provided to the mux for every listener.

Fixes #9891
Fixes #9397

Unblocks #9637

When there are multiple listeners configured for Addresses.API, serving metrics results in an errors: "<metric> was collected before with the same name and label values".

This PR fixes this by maintaining a global map of metrics handlers, and only creating and reginstering them once. The same metrics handlers are provided to the mux for every listener.

Fixes #9891
Fixes #9397

Unblocks #9637
@gammazero gammazero requested a review from lidel as a code owner August 21, 2024 22:12
@gammazero gammazero marked this pull request as draft August 21, 2024 22:17
@gammazero gammazero force-pushed the fix/metrics_with_multiple_listeners branch from 1d0d936 to 6c3dcdc Compare August 21, 2024 23:10
@gammazero gammazero force-pushed the fix/metrics_with_multiple_listeners branch from 6c3dcdc to 34ecff1 Compare August 22, 2024 00:51
@gammazero
Copy link
Contributor Author

no - need different approach

@gammazero gammazero closed this Aug 22, 2024
@gammazero gammazero deleted the fix/metrics_with_multiple_listeners branch August 22, 2024 01:15
@gammazero gammazero restored the fix/metrics_with_multiple_listeners branch August 22, 2024 03:31
@gammazero gammazero reopened this Aug 22, 2024
@gammazero gammazero closed this Aug 22, 2024
@gammazero gammazero removed the request for review from lidel August 22, 2024 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant