Available on crate feature
component
only.Expand description
Crate-specific metrics functionality.
This module re-exports the contents of the metrics
crate. This is
effectively a way to monkey-patch the functions in this module into the
metrics
crate, at least from the point of view of the other code in this
crate.
Code in this crate that wants to use metrics should use crate::metrics;
,
so that this module shadows the metrics
crate.
This trick is probably good to avoid in general, because it could be confusing, but in this limited case, it seems like a clean option.
Modules§
- Atomic types used for metrics.
Macros§
- Registers a counter.
- Describes a counter.
- Describes a gauge.
- Describes a histogram.
- Registers a gauge.
- Registers a histogram.
Structs§
- A counter.
- A gauge.
- A histogram.
- A metric identifier.
- Key-specific hashing algorithm.
- Name component of a key.
- Metadata for a metric key in the form of a key/value pair.
- Verbosity of a metric.
- Guard for setting a local recorder.
- Metadata describing a metric.
- A no-op recorder.
- Error returned when trying to install a global recorder when another has already been installed.
Enums§
- Value of a gauge operation.
- Units for a given metric.
Constants§
Traits§
- A counter handler.
- A gauge handler.
- A histogram handler.
- An object which can be converted into a
f64
representation. - A value that can be converted to a vector of
Label
s. - A trait for registering and recording metrics.
Functions§
- Registers all metrics used by this crate.
- Sets the recorder as the default for the current thread for the duration of the lifetime of the returned
LocalRecorderGuard
. - Sets the global recorder.
- Runs the closure with the given recorder set as the global recorder for the duration.
- Runs the closure with a reference to the current recorder for this scope.
Type Aliases§
- An allocation-optimized string.