-
Notifications
You must be signed in to change notification settings - Fork 93
Closed
Description
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:
let mut registry = <Registry>::default();
// (omitted)
// Using the OpenMetrics format.
let mut buffer = vec![];
encode(&mut buffer, ®istry).unwrap();
// On the other hand, send (partial) metrics in JSON, into an endpoint different from Prometheus server.
let mut data = vec![];
for (descriptor, metric) in registry.iter() {
if descriptor.name() == "__test__" {
data.push(
translate_to_json(metric), // original JSON format
);
}
}
send(data); // send to an endpoint different from Prometheus server
I think I need to implement custom encoder, translate metrics to JSON format.
Please let me know if there is any good way. 🙏
gamgi
Metadata
Metadata
Assignees
Labels
No labels