Chapter 5: Metrics – Recording Measurements
Tracing code execution throughout a system is one way to capture information about what is happening in an application, but what if we're looking to measure something that would be better served by a more lightweight option than a trace? Now that we've learned how to generate distributed traces using OpenTelemetry, it's time to look at the next signal: metrics. As we did in Chapter 4, Distributed Tracing – Tracing Code Execution, we will first look at configuring the OpenTelemetry pipeline to produce metrics. Then, we'll continue to improve the telemetry emitted by the grocery store application by using the instruments OpenTelemetry puts at our disposal. In this chapter, we will do the following:
- Configure OpenTelemetry to collect, aggregate, and export metrics to the terminal.
- Generate metrics using the different instruments available.
- Use metrics to gain a better understanding of the grocery...