All guides

OpenTelemetry: traces, metrics and logs through one collector

Applications send traces, metrics and logs over one protocol, OTLP, to a Collector. The Collector receives, processes and exports them to the backends you choose.

Hands on a laptop beside an open notebook

The signals and their stability

OpenTelemetry's specification status summary lists the signals like this:

  • Traces: the API, SDK and protocol are stable.
  • Metrics: the API and protocol are stable. The SDK specification is marked mixed.
  • Logs: the Bridge API, SDK and protocol are stable.
  • Baggage: stable. It attaches keys and values to a transaction for downstream services, and it has no Collector component.
  • Profiles: the protocol is in development.

Each language SDK has its own status. In November 2026 the status page lists logs as stable for Java, .NET and PHP, and as in development for Python and JavaScript. Read your language's row first.

From the application to the Collector

OpenTelemetry's documentation describes two ways to instrument a service, which can be used together.

  • Zero-code instrumentation adds the API and SDK to an application with no edit to its source. It instruments the libraries you use: requests and responses, database calls, message queue calls. It is available for .NET, Go, Java, JavaScript, PHP and Python.
  • Code-based instrumentation uses the OpenTelemetry API in your own code.

The SDK's OTLP exporter defaults to a local endpoint: http://localhost:4317 for gRPC and http://localhost:4318 for HTTP. The documentation shows these two variables for the service name and for another endpoint:

Shell

export OTEL_SERVICE_NAME="your-service-name"
export OTEL_EXPORTER_OTLP_ENDPOINT=http://collector.example.com:4318

The project recommends a Collector alongside your services. The service offloads data quickly, and the Collector takes care of retries, batching, encryption and sensitive data filtering.

Receivers, processors, exporters and pipelines

This is the first example on the Collector's configuration page:

YAML

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318
exporters:
  otlp_grpc:
    endpoint: otelcol:4317
    sending_queue:
      batch:
extensions:
  health_check:
    endpoint: 0.0.0.0:13133
  pprof:
    endpoint: 0.0.0.0:1777
  zpages:
    endpoint: 0.0.0.0:55679
service:
  extensions: [health_check, pprof, zpages]
  pipelines:
    traces:
      receivers: [otlp]
      exporters: [otlp_grpc]
    metrics:
      receivers: [otlp]
      exporters: [otlp_grpc]
    logs:
      receivers: [otlp]
      exporters: [otlp_grpc]
  • Receivers collect telemetry from one or more sources. otlp receives data over gRPC or HTTP. The Collector binds to localhost by default, and the page says its examples use 0.0.0.0 as a convenience.
  • Exporters deliver data to a backend or destination, or to several. batch under sending_queue is the exporter's batching setting.
  • Extensions add capabilities that do not process telemetry, such as health monitoring.
  • Pipelines are of type traces, metrics or logs. A component that is configured but not listed in the service section is not enabled.

Processors modify or transform data between receivers and exporters. They are optional, and the example has none. The memory limiter's README gives this one and says to put it first in a pipeline:

YAML

processors:
  memory_limiter:
    check_interval: 1s
    limit_mib: 4000
    spike_limit_mib: 800

Enable it with a line such as processors: [memory_limiter] in each pipeline. The limits are the README's example values. Set your own.

The official pages do not agree on exporter names. The configuration page uses otlp_grpc and otlp_http. The agent deployment page still shows an exporter of type otlp.

On 11 November 2026 the project announced that it is deprecating the batch processor. Batching is now supported directly in exporters, as in the example. The announcement plans the processor's removal for release v0.177.0, in May 2027.

Agent or gateway deployment

  • Agent. Signals go to a Collector that runs alongside the application or on the same host, such as a sidecar or a DaemonSet. The documentation calls it straightforward to start with and limited in scalability.
  • Gateway. Applications or other Collectors send to a single OTLP endpoint, provided by one or more Collector instances that run as a standalone service. Credentials and policy, such as filtering or sampling, are managed centrally. The listed costs are one more thing to maintain, added latency and higher resource usage.

The documentation also describes the two combined: agents on each host forward to gateways, which do the centralized processing.

Core and contrib distributions

The project offers pre-built distributions:

  • Core (otelcol) holds the components from the core repository and a small selection from contrib. Its README calls it classic.
  • Contrib (otelcol-contrib) holds all the components from both repositories. Its README calls it a good starting point, and for production it recommends a Collector limited to the components you need, built with the OpenTelemetry Collector Builder.

The Collector's overall status is mixed, and each component documents its stability in its README.

Head and tail sampling

Head sampling makes the decision as early as possible, with no view of the whole trace. Its most common form, the documentation says, decides from the trace ID and a target percentage. It is efficient, but it cannot ensure that every trace with an error is kept. Tail sampling decides by considering all or most of a trace's spans, so it can always keep traces that contain an error. Its components must be stateful. In a gateway, a first tier with the load-balancing exporter sends all spans of a trace to the same Collector.

What to check first

  1. Validate each configuration with the documented command, otelcol validate --config=customconfig.yaml.
  2. Add the debug exporter to a pipeline to see that data arrives. Its default verbosity, basic, prints a one-line summary with a count for every batch.
  3. Set GOMEMLIMIT. The memory limiter's README recommends 80% of the Collector's hard memory limit.
  4. Remove the batch processor from any pipeline whose exporter batches. The Collector warns at startup when a pipeline has both.
  5. Read the stability of each component you add in its README.

Sources

Want a second pair of eyes on yours? We do this work for a living.

Book a call

More guides