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

Add RewritingMetricsHandler #136

Closed
wants to merge 1 commit into from

Conversation

hamzahrmalik
Copy link
Contributor

Add RewritingMetricsFactory

Motivation:

Sometimes we need rewrite the names of metrics or dimensions into different names. This could be, for example, to make metrics from a new system match what they were in an older system

Modifications:

Add a new MetricsRewriter protocol, which describes how to rewrite metrics
Add a new RewritingMetricsHandler, an implementation of MetricsFactory which takes a MetricsRewriter and passes all metrics through it

Notes

  • Added a new MetricsWithDimensions type. We might want to make it possible to also use this type in other places (places which currently take a label and dimensions separately)
  • The new handler is generic over the underlying factory. This means you cannot initialise it with any MetricsFactory. This is because I expect people to have a concrete type at startup when they would create this handler

@ktoso
Copy link
Member

ktoso commented Aug 4, 2023

I think overall this is a great idea, but we probably need to re-consider if we want this in core or maybe would be better to keep in metrics-extras. I know folks would prefer this in a "1.0 package" but that's something we need to discuss separately.

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.

None yet

2 participants