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 support for exemplars #94

Open
jkylling opened this issue Dec 31, 2024 · 0 comments
Open

Add support for exemplars #94

jkylling opened this issue Dec 31, 2024 · 0 comments

Comments

@jkylling
Copy link

It would be useful to support observing exemplars on the default metrics, for instance to have trace IDs as exemplars.

We could add another function ExemplarFunc func(c *gin.Context) string to the Prometheus struct. If the function is non-nil, and the string it returns is non-nil, then the exemplar returned is used when incrementing and observing the request count, duration and sizes. This would enable having trace IDs as exemplars, which can make it simpler to connect metrics to traces.

There is an implementation using exemplars at https://github.com/wei840222/gin-prometheus which is a bit less configurable.

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

No branches or pull requests

1 participant