Observability with OpenTelemetry: Traces, Metrics, and Logs
Unify traces, metrics, and logs with OpenTelemetry. Instrumentation, sampling, and backend-agnostic pipelines.
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.
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
GitHub Copilot CLI Sandboxing Is GA: What Actually Changed
GitHub made local sandboxing generally available for Copilot CLI on October 7, so the default now restricts the agent instead of trusting it.
The Tensorlake npm Compromise Targeted Your AI Tool Configs
A compromised npm release went after cloud credentials as expected, and local AI coding-assistant config files, which most teams never treated as secrets.
GitLab's New Rate Limits: What to Fix Before Oct 19
GitLab is capping unauthenticated API calls at 60 an hour starting October 19, and the preview windows land before most teams will have noticed.
You might have missed
Evergreen posts worth revisiting.