Skip to main content
Observability with OpenTelemetry: Traces, Metrics, and Logs

Observability with OpenTelemetry: Traces, Metrics, and Logs

KU
• 1 min read•29 views

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)

javascript.javascript
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

  1. Sample in production (e.g. 10% of traces) to control cost and volume.
  2. Set resource attributes (service.name, deployment.environment) for filtering.
  3. Use semantic conventions so dashboards and alerts stay consistent.
  4. Secure exporters (TLS, auth) and avoid PII in spans.

Start with one service and one backend; then roll out and add more signals.

Explore topics:KubernetesDockerDevOps
React
Share this post
KU

Kiril Urbonas

AI Engineer

553 articles
View all articles by Kiril Urbonas

You might have missed

Evergreen posts worth revisiting.