#metrics #service #performance #goodmetrics

goodmetrics

Stackwise, dynamic workflow metrics recording - for services

6 stable releases

Uses new Rust 2021

1.2.0 Dec 2, 2022
1.1.0 Dec 1, 2022
1.0.3 Nov 30, 2022
1.0.1 Nov 23, 2022

#78 in Profiling

Download history 32/week @ 2022-11-17 62/week @ 2022-11-24 102/week @ 2022-12-01

196 downloads per month

Apache-2.0

73KB
2K SLoC

Goodmetrics: Rust

About

This is the Rust goodmetrics client. It bundles an opentelemetry protocol downstream and some performance tools like the PooledMetricsAllocator. To use any grpc downstream (goodmetrics or opentelemetry) you will need a tokio runtime.

How to use

See the lightstep demo for a complete setup and usage example with opentelemetry.

Once you have a configured MetricsFactory, the way you use Metrics does not change with subsequent updates to the configured downstream(s):

let metrics = metrics_factory.record_scope("demo"); // By default, includes a "demo_totaltime" histogram measurement
let _scope = metrics.time("timed_delay"); // you can time additional scopes
metrics.measurement("ran", 1); // measurements can be plain numbers; when preaggregated they are StatisticSets (min/max/sum/count)
metrics.dimension("mod", i % 8); // you can add dimensions to a Metrics whenever you want. All measurements in this Metrics record are dimensioned by this value.
metrics.distribution("some_continuous_value", instantaneous_network_bandwidth); // histograms are aggregated sparsely, and truncated to 2 significant figures (base 10).

Development

Use cargo bump major/minor/patch --git-tag to update version.

Dependencies

~16–23MB
~437K SLoC