#metrics #json #telemetry #json-format


A metrics-core compatible observer that outputs JSON

2 releases

0.1.1 Jul 30, 2019
0.1.0 Jul 30, 2019

#57 in #telemetry

Download history 967/week @ 2023-12-12 981/week @ 2023-12-19 1880/week @ 2023-12-26 854/week @ 2024-01-02 1002/week @ 2024-01-09 1010/week @ 2024-01-16 852/week @ 2024-01-23 1699/week @ 2024-01-30 733/week @ 2024-02-06 1451/week @ 2024-02-13 655/week @ 2024-02-20 710/week @ 2024-02-27 728/week @ 2024-03-05 431/week @ 2024-03-12 945/week @ 2024-03-19 1055/week @ 2024-03-26

3,249 downloads per month
Used in 9 crates (2 directly)

MIT license



conduct-badge downloads-badge release-badge docs-badge license-badge

metrics-observer-json is a metrics-core compatible observer that outputs JSON.

code of conduct

NOTE: All conversations and contributions to this project shall adhere to the Code of Conduct.


Observes metrics in JSON format.

Metric scopes are used to provide the hierarchy of metrics. As an example, for a snapshot with two metrics — server.msgs_received and server.msgs_sent — we would expect to see this output:


If we added another metric — configuration_reloads — we would expect to see:


Metrics are sorted alphabetically.


Histograms are rendered with a configurable set of quantiles that are provided when creating an instance of JsonBuilder. They are formatted using human-readable labels when displayed to the user. For example, 0.0 is rendered as "min", 1.0 as "max", and anything in between using the common "pXXX" format i.e. a quantile of 0.5 or percentile of 50 would be p50, a quantile of 0.999 or percentile of 99.9 would be p999, and so on.

All histograms have the sample count of the histogram provided in the output.



~31K SLoC