Understand OpenTelemetry architecture, signals, Collector, instrumentation, and Kubernetes deployment for cloud-native observability.

A single user request can involve several independently deployed services. For example, an order request might pass through an API gateway, inventory service, payment service, and database. If payment processing takes several seconds, engineers need to identify where the delay occurs.

Logs record events, metrics measure performance, and traces show how requests move between services. When these signals remain in separate systems, connecting an error log to the affected request becomes harder. Vendor-specific agents can also make it difficult to standardize telemetry across applications.

OpenTelemetry tackles these challenges by standardizing how applications generate and export telemetry. It gives engineering teams a common framework for collecting traces, metrics, and logs across distributed systems.

This guide examines OpenTelemetry architecture, instrumentation methods, Collector pipelines, and deployment considerations. It also explains how engineers can introduce OpenTelemetry into existing infrastructure.

What Is OpenTelemetry?

OpenTelemetry is an open-source, vendor-neutral framework for generating, collecting, processing, and exporting application telemetry. It provides APIs, SDKs, and tools for producing traces, metrics, and logs. Applications can send this data to compatible observability backends for storage and analysis.

The project emerged from the merger of OpenTracing and OpenCensus. It provides a shared approach to instrumenting applications across programming languages and infrastructure environments.

OpenTelemetry does not store or visualize telemetry. Instead, it handles instrumentation and data collection. A separate backend must store, query, and display the information.

For example, an engineering team can instrument a payment service with OpenTelemetry. It can then send traces and metrics to a compatible monitoring platform without tying its application instrumentation to that platform.

This separation offers flexibility when teams change observability backends. However, backend-specific dashboards, queries, and alerting rules may still create dependencies.

What Are the Core OpenTelemetry Signals?

OpenTelemetry supports three primary telemetry signals: traces, metrics, and logs. Each describes a different aspect of application activity.

1. Traces

Traces show how a request travels through an application. They are especially useful when one operation involves several services.

A trace contains one or more spans. A span records one operation, such as handling an HTTP request or executing a database query.

A span can include:

  • Trace ID: Identifies the complete request across services.
  • Span ID: Identifies an individual operation.
  • Parent span ID: Connects an operation to its parent.
  • Attributes: Describe the operation, such as its service name or HTTP method.
  • Events: Record significant occurrences during the operation.
  • Status: Indicates whether the operation succeeded or failed.

Consider an online order that passes through an API, inventory service, and payment service. A distributed trace shows the time spent in each operation. Engineers can use this information to locate the service responsible for latency or failure.

2. Metrics

Metrics represent measurements collected over time. They help engineers monitor application performance, resource usage, and operational trends.

OpenTelemetry supports several metric instruments:

  • Counters: Track cumulative values, such as completed requests.
  • Gauges: Record current values, such as active connections.
  • Histograms: Measure distributions, such as request latency.

A team might monitor request rates, error counts, and response-time distributions. These measurements help identify performance changes and establish alerting thresholds.

Metric cardinality also requires attention. Every unique combination of metric attributes can create a separate time series. High-cardinality attributes, such as user IDs or request IDs, can increase storage and processing costs.

3. Logs

Logs record discrete events generated by applications and infrastructure. They provide details about errors, state changes, and application activity.

OpenTelemetry supports log data collection and export. It can also associate logs with trace and span context when that information is available.

When logs contain matching trace and span IDs, engineers can locate entries associated with a specific operation. This makes it easier to investigate an error alongside the request that triggered it.

What Is Baggage in OpenTelemetry?

Baggage is not a fourth telemetry signal. It is a mechanism for propagating contextual key-value data across distributed service boundaries.

For example, an application may propagate a tenant identifier or workflow context between services. Engineers should avoid placing sensitive information in Baggage because downstream services may receive it.

How Does OpenTelemetry Architecture Work?

OpenTelemetry uses APIs, SDKs, and the OpenTelemetry Protocol (OTLP) to generate and transport telemetry.

The typical data flow follows these stages:

  1. Instrumentation: Application libraries or developers generate telemetry.
  2. SDK processing: The OpenTelemetry SDK manages sampling, processing, and export.
  3. Data transmission: The application exports telemetry through OTLP or another supported exporter.
  4. Collection: An OpenTelemetry Collector receives and processes the data when deployed.
  5. Export: The Collector or application sends telemetry to an observability backend.
  6. Analysis: The backend stores and presents the data for monitoring and investigation.

OpenTelemetry API and SDK

The OpenTelemetry API provides interfaces that application code uses to create telemetry. It defines how developers obtain tracers, meters, and loggers.

The SDK implements these interfaces. It manages telemetry generation, configuration, sampling, processing, and export.

This distinction separates application instrumentation from the underlying telemetry implementation. Developers can write instrumentation against the API without directly coupling application code to a particular SDK implementation.

OpenTelemetry Protocol (OTLP)

OTLP is the standard protocol used to transmit OpenTelemetry data between components.

It supports two common transport options:

  • OTLP/gRPC: Uses gRPC and commonly listens on port 4317.
  • OTLP/HTTP: Uses HTTP and commonly listens on port 4318. It supports Protobuf and JSON payloads.

Applications can export telemetry directly to a backend or send it to an OpenTelemetry Collector. Choose the transport based on network design, Collector configuration, and backend compatibility.

What Is the OpenTelemetry Collector?

The OpenTelemetry Collector is a vendor-neutral service that receives, processes, and exports telemetry. It separates telemetry handling from application code and provides a central point for managing data pipelines.

A Collector pipeline typically contains three main component types.

Receivers

Receivers accept telemetry from applications and other systems. They can receive OTLP data or collect telemetry through supported integrations.

For example, an application can send traces and metrics to an OTLP receiver.

Processors

Processors modify or manage telemetry before export. Common examples include:

  • Batch processor: Groups telemetry into batches to improve export efficiency.
  • Memory limiter: Applies memory limits and helps reduce the risk of excessive memory use.
  • Attributes processor: Adds, updates, or removes attributes.
  • Tail sampling processor: Makes sampling decisions after examining trace data.
  • Redaction or filtering processors: Remove or restrict selected telemetry information, depending on configuration.

Tail sampling requires particular care. All spans belonging to a trace must reach the same sampling decision point. In multi-Collector deployments, teams need trace-aware routing to avoid splitting a trace across independent sampling Collectors.

Exporters

Exporters send processed telemetry to configured destinations. These may include observability platforms, telemetry storage systems, or another Collector.

Available exporters depend on the Collector distribution and component support. Check component maturity and compatibility before selecting an exporter for production.

Connectors link telemetry pipelines, while extensions add capabilities such as health checks and authentication.

How Do You Instrument Applications With OpenTelemetry?

Instrumentation adds telemetry generation to application code or supported runtime libraries. Teams can choose automatic instrumentation, manual instrumentation, or a combination of both.

Automatic Instrumentation

Automatic instrumentation uses supported libraries, agents, or runtime integrations to capture telemetry with minimal application changes.

Language-specific agents can capture HTTP requests, database calls, and framework activity. For example, an agent can record supported HTTP requests before developers add custom spans.

However, automatic instrumentation does not capture every business operation. Custom workflows may require manual spans and attributes to explain application behavior.

Manual Instrumentation

Manual instrumentation lets developers create spans and add context around important operations. It is useful when teams need visibility into business workflows that automatic instrumentation cannot identify.

The following Python example creates a span around a payment operation:

from opentelemetry import trace
from opentelemetry.trace import Status, StatusCode

tracer = trace.get_tracer(__name__)

def process_order(order_id, amount):
    with tracer.start_as_current_span("process_payment") as span:
        span.set_attribute("order.id", order_id)
        span.set_attribute("payment.amount", amount)

        try:
            execute_gateway_charge(amount)
        except Exception as error:
            span.record_exception(error)
            span.set_status(Status(StatusCode.ERROR))
            raise

The span records the payment operation and adds attributes that help engineers investigate it. If the operation fails, the code records the exception and marks the span as an error.

In production, teams should review which attributes they collect. Order identifiers and payment details may expose sensitive business information. Avoid recording card data, credentials, or personal information in telemetry.

Automatic vs. Manual Instrumentation

Aspect Automatic instrumentation Manual instrumentation
Setup Uses supported agents or integrations Requires application code changes
Coverage Captures supported libraries and frameworks Captures selected business operations
Maintenance Depends on agent and library compatibility Requires developers to maintain instrumentation
Best suited for Initial application visibility Custom workflows and business context

Automatic instrumentation captures supported framework activity. Manual spans add context around operations such as order validation or payment authorization.

How Is OpenTelemetry Used in Kubernetes?

In Kubernetes, pods move between nodes and workloads scale up or down. This makes telemetry collection more complex, particularly when applications run across multiple services and namespaces.

Teams commonly deploy the OpenTelemetry Collector in two ways.

Agent deployment: A Collector runs on each Kubernetes node, often as a DaemonSet. It collects telemetry from local workloads and node-level sources. This model keeps collection close to the workloads.

Gateway deployment: A Collector runs as a centralized service, commonly through a Deployment. Applications or agents send telemetry to the gateway, which processes and exports it.

A node-level Collector can forward telemetry to a gateway Collector for centralized processing. This combination separates local collection from shared processing and export responsibilities.

During deployment, engineers should consider:

  • Service discovery: Ensure telemetry identifies the correct service and environment.
  • Resource attributes: Add useful metadata, such as service name, namespace, and deployment environment.
  • Scaling: Size Collectors according to telemetry volume and processing requirements.
  • High availability: Avoid making a single Collector instance a critical point of failure.
  • Networking: Configure application-to-Collector and Collector-to-backend connectivity.
  • Monitoring: Track Collector health, memory usage, dropped data, and export failures.

Kubernetes metadata improves troubleshooting, but unnecessary attributes increase telemetry volume. Teams should also test how Collectors behave during pod restarts, network interruptions, and backend outages.

How Does OpenTelemetry Compare With Prometheus, Grafana, and Jaeger?

OpenTelemetry works alongside several established observability tools. These tools serve different roles rather than providing interchangeable functionality.

Tool Primary role
OpenTelemetry Generates, collects, processes, and exports telemetry
Prometheus Collects and stores metrics and supports monitoring
Grafana Visualizes metrics and other observability data through dashboards
Jaeger Stores, queries, and visualizes distributed traces

For example, an application can use OpenTelemetry instrumentation to generate traces and metrics. A Collector can export metrics to Prometheus and traces to Jaeger. Grafana can then provide dashboards using compatible data sources.

The exact integration depends on the selected backend and supported exporters. Teams should check compatibility before designing the telemetry pipeline.

What Should Teams Consider Before Production Deployment?

Installing an agent or Collector does not guarantee that telemetry will be complete, accurate, or useful. Teams must configure instrumentation, data handling, and export behavior.

Start with critical services. Instrument services that handle important user requests or business operations. Test one request path before expanding coverage.

Define service conventions. Use consistent service names, environment attributes, and resource metadata. Semantic conventions help standardize common telemetry attributes.

Control telemetry volume. Configure sampling and filtering based on troubleshooting requirements. Review metric cardinality and avoid collecting unnecessary attributes.

Protect sensitive data. Review spans, logs, and metric attributes for credentials, personal information, and business-sensitive values. Apply filtering and access controls where appropriate.

Monitor the Collector. Track resource usage, queue behavior, export failures, and dropped telemetry. Memory limits and batching settings should reflect measured traffic and resource usage.

Plan for failures. Test what happens when a Collector becomes unavailable or a backend stops accepting data. Review queue settings, retry behavior, and data-loss risks.

Validate the complete pipeline. Confirm that applications generate telemetry, Collectors receive and export it, and backends display the expected data. Test failure scenarios as well as normal operations.

What Is OpenTelemetry Profiling?

Profiling records where an application spends CPU time and how it uses memory. Engineers can use profiles to investigate CPU-intensive functions or memory allocation patterns that traces and metrics do not expose.

OpenTelemetry profiling is a developing capability intended to bring profiling data into the broader observability ecosystem. Its maturity and implementation support may vary.

Check the current stability and compatibility of profiling components before depending on them in production.

Frequently Asked Questions

1. Is OpenTelemetry a monitoring tool?

OpenTelemetry is not a monitoring platform. It provides the instrumentation and collection components needed to generate and export telemetry. Teams still need a backend to store, query, visualize, and analyze that data.

2. Does OpenTelemetry replace Prometheus or Grafana?

No. OpenTelemetry and these tools serve different purposes. OpenTelemetry handles telemetry generation and collection, Prometheus handles metrics monitoring, and Grafana provides dashboards and visualizations. They can work together in the same observability setup.

3. Can OpenTelemetry work without a Collector?

Yes. An instrumented application can export telemetry directly to a compatible backend. However, a Collector provides a separate layer for processing, filtering, batching, and routing telemetry. This becomes useful when several applications send data to multiple destinations.

4. Does OpenTelemetry support Kubernetes?

Yes. OpenTelemetry supports Kubernetes workloads through application instrumentation, Kubernetes integrations, and Collector deployments. Teams can run Collectors as DaemonSets on individual nodes or deploy gateway Collectors for centralized processing.

5. Does OpenTelemetry add application overhead?

Yes. Instrumentation, data processing, and telemetry export consume CPU, memory, and network resources. The impact depends on the number of instrumented operations, sampling configuration, and telemetry volume. Teams should benchmark overhead under representative workloads.

Conclusion

OpenTelemetry standardizes telemetry generation and collection across distributed applications. Its APIs, SDKs, OTLP, and Collector support different instrumentation and deployment models.

Before expanding coverage, test one critical request path from application instrumentation to backend storage. Check trace correlation, metric cardinality, sampling decisions, and sensitive attributes. These checks establish whether the telemetry pipeline can support production troubleshooting.