Observability with OpenTelemetry: Traces, Metrics, and Logs
Unify traces, metrics, and logs with OpenTelemetry. Instrumentation, sampling, and backend-agnostic pipelines.
Key takeaways
- Unify traces, metrics, and logs with OpenTelemetry.
- Instrumentation, sampling, and backend-agnostic pipelines.
On this page
Observability with OpenTelemetry: Traces, Metrics, and Logs#
OpenTelemetry gives you a single, vendor-neutral way to emit traces, metrics, and logs. Here’s how to adopt it.
Why OpenTelemetry#
- Vendor-neutral: Switch backends (Jaeger, Prometheus, Datadog, etc.) without changing app code.
- Single SDK: One instrumentation story for many languages.
- Correlation: Link trace IDs to logs and metrics for faster debugging.
Quick Instrumentation (Node.js)#
const { NodeSDK } = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const sdk = new NodeSDK({
traceExporter: myExporter,
metricReader: myMetricReader,
instrumentations: [getNodeAutoInstrumentations()],
});
sdk.start();
Best Practices#
- Sample in production (e.g. 10% of traces) to control cost and volume.
- Set resource attributes (service.name, deployment.environment) for filtering.
- Use semantic conventions so dashboards and alerts stay consistent.
- Secure exporters (TLS, auth) and avoid PII in spans.
Start with one service and one backend; then roll out and add more signals.
Get the DevOps Troubleshooting Cheat Sheet
Subscribe and get our free one-page reference for the errors that eat an afternoon — CrashLoopBackOff, OOMKilled, Terraform state locks, and more — plus new guides as we publish them.
Best Practices: Terraform State Isolation by Environment
One Terraform state file per environment sounds obvious until you watch a dev plan touch a prod resource. Here's how we actually isolate state and the mistakes we made getting there.
Best Practices: Ansible Role Design for Large Teams
A team of 30 engineers all editing the same monolithic Ansible repo doesn't work. Here's the role taxonomy and review process that did.
More from DevOps
Explore more articles in this category
Best Kubernetes IDE and GUI Tools in 2026
kubectl is fine until you're juggling five namespaces across three clusters. These are the tools that make that manageable, compared.
Chef vs Puppet vs Ansible: Configuration Management in 2026
One is agentless and Python-based, the other two run a persistent agent and a domain-specific language. The architecture difference matters more than the syntax.
PagerDuty vs Opsgenie: Choosing an Incident Alerting Tool
Both page the right person at 3am and both integrate with everything. The real differences show up in pricing structure, workflow depth, and who already owns the ecosystem around you.
You might have missed
Evergreen posts worth revisiting.