instrumentation
What is instrumentation?
instrumentation: The code that emits metrics, logs and traces. Can be manual (you add it) or automatic (an agent/library injects it). Instrumentation is the code that makes a system observable: the metrics, logs and traces it emits about what it is doing. Without it, you only know a system is slow or broken when users tell you.
Frequently asked questions about instrumentation
How is instrumentation used in practice?
Some instrumentation is automatic. OpenTelemetry agents and framework integrations add traces for HTTP requests and database queries without code changes. Other instrumentation is manual, such as a counter for completed checkouts or a span around an important business step.
What should you keep in mind with instrumentation?
Start with automatic instrumentation for the basics, then add manual measurements for what matters to the business. Use consistent names and labels, and avoid high-cardinality values like user IDs in metrics. Good instrumentation turns "the site feels slow" into "the payment API call takes four seconds since yesterday".
What does an example of instrumentation look like?
span := tracer.Start(ctx, "checkout") defer span.End() At a glance
| Category | Observability |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |