Expand description
A trait for collecting and managing performance metrics within the pipeline.
The Metrics
trait defines a set of asynchronous methods for initializing,
updating, flushing, and shutting down metrics in the carbon-core
framework.
This trait is designed for tracking various types of metrics, such as counters,
gauges, and histograms, to monitor performance and operational health in real time.
§Key Concepts
- Gauges: Track the value of a particular metric at a specific point in time. Useful for monitoring values that can fluctuate, like the number of queued updates.
- Counters: Track the number of times an event has occurred, such as successful or failed update processing.
- Histograms: Measure the distribution of values, such as processing times, allowing insights into latency or response times.
§Implementing the Trait
To implement Metrics
, provide implementations for each method, typically sending
metrics data to a monitoring system or backend service for visualization and alerting.
The trait requires async
functions, allowing implementations to perform non-blocking
I/O operations, such as network requests or database writes.