OpenTelemetry Instrumentation Cheat Sheet

SDK setup, attributes, and exporters

Last Updated: November 21, 2025

Focus Areas

Focus
Initialize the SDK per service with shared resource attributes
Propagate context across threads and async boundaries

Commands & Queries

OTEL_SERVICE_NAME=my-app otelcol --config=collector.yaml
Start the collector with environment tagging
python -m opentelemetry.instrumentation.auto_instrument myapp:app
Auto-instrument supported Python libs
curl -X POST http://localhost:4318/v1/traces -d @span.json
Verify trace ingestion on the OTLP endpoint

Summary

Standardize on OpenTelemetry semantics, send traces/metrics via OTLP, and review exporters after each release.

💡 Pro Tip: Use semantic attributes for service, method, and version while sampling intentionally.
← Back to DevOps & Cloud | Browse all categories | View all cheat sheets