-
Notifications
You must be signed in to change notification settings - Fork 81
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
Custom encoder? #46
Comments
👋 Hi @ackintosh,
Yes, you would need to implement something along the lines of https://github.com/prometheus/client_rust/blob/master/src/encoding/text.rs. Though lots of the internals you would need are not exposed to the outside. Is this a well known format you are referring to? Would it make sense to contribute it to the library? Or would it maybe make sense to add the OpenMetrics protobuf format to this library which you could then consume and convert to your JSON output? |
Hi @mxinden !
As a background of I've file this issue, I'm working on this issue. The metrics I would like to send to somewhere in JSON is defined as Ethereum consensus client metrics and Beacon chain metrics.
I think the latter would be good as we can convert the metrics to JSON. though I'm not familiar with the OpenMetrics protobuf format for now. 💦 |
I would guess that most https://github.com/OpenObservability/OpenMetrics should be a good first starting point. |
This is out of scope for this crate. |
I believe too that it make sense to add the OpenMetrics protobuf format to
Thank you for the pointer! That helped a lot. And I have noticed that prometheus-client doesn't support the OpenMetrics protobuf format due to the issue. 👀 https://github.com/prometheus/client_rust#specification-compliance
|
That was the thing that stopped me from working on Protobuf support in |
Yes, I will try to add support for Protobuf. Will file a PR later. 🚀 |
I would like to send (partial) metrics stored the
Registry
in original JSON format differ from OpenMetrics, into an endpoint different from Prometheus server.Here is a pseudo code, shows what I want to do:
I think I need to implement custom encoder, translate metrics to JSON format.
Please let me know if there is any good way. 🙏
The text was updated successfully, but these errors were encountered: