Crate goodmetrics

Source
Expand description

A Rust implementation of goodmetrics; a low-overhead, expressive metrics infrastructure built for web services.

[goodmetrics] is a metrics recording toolbox built on tonic and [gRPC]. It focuses on your service first - metrics are never more important than your users. After that, high performance, low predictable overhead, and ease of maintenance are prioritized.

§Examples

Some basic examples can be found under src/benches.

§Getting Started

Check out goodmetrics documentation for database setup and general ecosystem information.

§Feature Flags

Modules§

aggregation
Types for working with in-memory local aggregations
allocator
How Metrics objects are created and possibly cached.
downstream
Types related to emitting metrics to collectors
introspect
The introspect feature. This records and reports metrics about your metrics pipeline.
pipeline
Types for wiring to downstream collectors
proto
Internal generated types - ideally you shouldn’t need to do much with them. Nevertheless, they are exported in case you need them.

Structs§

DimensionGuard
A drop guard for a dimension, so you can know what happened, e.g., in an async workflow that timed out & dropped.
GaugeDimensions
A GaugeDimensions is a group of dimensions to be used with a gauge. It is consumed when the gauge is created.
GaugeFactory
A handle for creating gauges.
GaugeGroup
Gauges grouped by a shared dimension position
HistogramHandle
Handle to a histogram gauge. If all of these are dropped, the gauge will be dropped.
Metrics
A Metrics encapsulates a unit of work.
MetricsFactory
Example complete preaggregated metrics pipeline setup, with gauge support:
StatisticSetHandle
Handle to a statistic set gauge. If all of these are dropped, the gauge will be dropped.
SumHandle
Handle to a sum gauge. If all of these are dropped, the gauge will be dropped.
TimeGuard
A guard that observes the time since it was created when dropped.
Timer
Scope guard for recording nanoseconds into a Metrics. Starts recording when you create it. Stops recording and puts its measurement into the Metrics as a distribution when you drop it.

Enums§

Dimension
The value part of a dimension’s key/value pair.
Distribution
Values able to be collected into a distribution
Measurement
Abstraction of measurement kinds - the more unary observation-oriented kind and the distribution kind.
MetricsBehavior
Behavior customization for advanced use of metrics
Name
An identifier for various things.
Observation
Individual values

Functions§

default_gauge_factory
The default gauge factory. You should use this unless you have some fancy multi-factory setup.