liminfo

OpenTelemetry Reference

Free reference guide: OpenTelemetry Reference

27 results

About OpenTelemetry Reference

The OpenTelemetry Reference is a searchable quick-reference for the OpenTelemetry observability framework. It covers traces (TracerProvider, Span, SpanContext, SpanKind, BatchSpanProcessor), metrics (MeterProvider, Counter, Histogram, UpDownCounter, ObservableGauge), logs (LoggerProvider, Log Records, Bridge API, Log Correlation), SDK setup (NodeSDK, Resource, Context Propagation, Sampler, Semantic Conventions), Collector configuration (receivers, processors, exporters, pipelines), and instrumentation (HTTP, Express, database, custom).

Built for backend engineers, SREs, and DevOps teams working with distributed tracing and observability pipelines, this reference provides copy-ready TypeScript and YAML code snippets for every OpenTelemetry component.

All 28 entries are organized into six categories -- Traces, Metrics, Logs, SDK, Collector, and Instrumentation -- enabling fast lookup during implementation, debugging, or architecture review.

Key Features

  • TracerProvider, Span, SpanContext, and SpanKind configuration with TypeScript examples
  • Metrics API reference: Counter, Histogram, UpDownCounter, and ObservableGauge
  • LoggerProvider setup with log correlation to traces via trace_id and span_id
  • NodeSDK all-in-one setup with auto-instrumentation and Resource configuration
  • Collector pipeline configuration in YAML: receivers, processors, exporters, and service pipelines
  • Auto-instrumentation examples for HTTP, Express, PostgreSQL, and MySQL
  • Sampling strategies including TraceIdRatioBasedSampler and W3C context propagation
  • Searchable and filterable across all six categories with instant results

Frequently Asked Questions

What OpenTelemetry components does this reference cover?

It covers all three observability pillars -- traces (TracerProvider, spans, span processors), metrics (Counter, Histogram, UpDownCounter, ObservableGauge), and logs (LoggerProvider, log records, bridge API). It also includes SDK configuration (NodeSDK, Resource, Sampler), Collector pipelines (receivers, processors, exporters), and instrumentation libraries (HTTP, Express, databases).

What programming language are the examples in?

All code examples use TypeScript with the @opentelemetry Node.js SDK packages. The Collector configuration examples use YAML format. The concepts apply to all OpenTelemetry-supported languages, but the syntax shown is Node.js/TypeScript specific.

How do I set up OpenTelemetry in a Node.js application?

Use the NodeSDK class from @opentelemetry/sdk-node with getNodeAutoInstrumentations() for automatic instrumentation. Set serviceName, configure exporters (OTLP HTTP or gRPC), and call sdk.start(). The reference includes the complete setup code.

What is the difference between Counter, Histogram, and UpDownCounter?

A Counter only increments (e.g., request count). A Histogram records value distributions (e.g., response latency in ms). An UpDownCounter can both increment and decrement (e.g., active connections). ObservableGauge is for async values read via callback (e.g., memory usage).

How do I configure the OpenTelemetry Collector?

The Collector uses a YAML config with four sections: receivers (OTLP gRPC/HTTP, Prometheus scraper), processors (batch, filter, attributes), exporters (OTLP, Prometheus, Loki), and service pipelines that wire them together. The reference provides copy-ready YAML for each section.

How does log correlation with traces work?

When you emit a log record with context.active(), OpenTelemetry automatically injects the current trace_id and span_id into the log. This lets you correlate logs with the exact trace and span that produced them in backends like Grafana Loki or Elasticsearch.

What sampling strategies are available?

The reference covers TraceIdRatioBasedSampler for percentage-based sampling (e.g., 10% of traces). OpenTelemetry also supports AlwaysOn, AlwaysOff, and ParentBased samplers. You configure the sampler in the TracerProvider or NodeSDK options.

Is this OpenTelemetry reference free?

Yes, it is completely free with no account registration required. All content runs in your browser with no server processing. It is part of liminfo.com's collection of free developer reference tools.