Configuring the metrics pipeline
The metrics signal was designed to be conceptually similar to the tracing signal. The metrics pipeline consists of the following:
- A MeterProvider to determine how metrics should be generated and provide access to a meter.
- The meter is used to create instruments, which are used to record measurements.
- Views allow the application developer to filter and process metrics produced by the software development kit (SDK).
- A MetricReader, which collects metrics being recorded.
- The MetricExporter provides a mechanism to translate metrics into an output format for various protocols.
There are quite a few components, and a picture always helps me grasp concepts more quickly. The following figure shows us the different elements in the pipeline:
MeterProvider
can be associated with a resource to identify the source of metrics produced. We'll see shortly how we can reuse the LocalMachineResourceDetector...