-
-
Notifications
You must be signed in to change notification settings - Fork 67
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 basic prometheus exporter #238
Add basic prometheus exporter #238
Conversation
Feature: add prometheus exporter
feature: fix subscriptions metric
feature: fix subscriptions metric
* Support for traceparent correlation header When receiving a NATS header containing a traceparent id then we relay it to subsequent collection requests to allow the server application to correlate them.
* Setup GitHub Actions - Build and push Docker image to GitHub Container Registry. - Run tests and linting. - Update Dockerfile to use less strict base image. * Add OCI image source for permissions
@jirenius will this not be merged? Would be cool to have some basic metrics |
Sorry for the radio silence. The resgate project has been on ice for a while, even if the gateway has been actively used in other projects lead by me. Now I am working on a new release with some further improvements, bugfixes, and updated dependencies. Also, thanks for this PR inspiring other improvements! |
Testing it, I see one issue with the number of dependencies that comes with the prometheus package. The compiled file size increased with about 60% (6MB), making the server more vulnerable to dependency abuse chains. One option would be to use a dependency-free package (eg. github.com/bsm/openmetrics ) to expose the desired metrics.
I think I'll skip:
|
Ah, that is nice! For the grouping of resource IDs, Resgate would need some sort of knowledge of patterns. In your branch, you've solved it by detecting {id} and {uuid} parts. But I will try to see if I can come up with a more generic way to solve it. One way would be to provide resgate with resource patterns to track metrics through configuration: {
"metrics": {
"resourcePatterns": [
"availability.client.*",
"availability.client.*.user.*",
"availability.client.*.user.*.device",
"availability.client.*.user.*.device.*",
"dashboard.client.*",
"dashboard.queue.*",
"usertoken"
]
}
} It would require you to manually update resgate's configuration with the resource patterns. Anyway. While I failed to merge your PR into |
We are recently running Resgate on our platform; thank you for this repo, by the way. However, we still needed basic metrics from it, so we decided to add the possibility of having a Prometheus exporter in Resgate to have insight into how it is operating.
We also upgraded to the latest Golang version, but if required, we can remove those changes from this pull request.
I hope this helps!