Study guide

7.3 Standard Exporters & OTLP Wire Protocols

OpenTelemetry Certified Associate OTCA

Track your progress as you read

Finished sections get a check mark.

1 Chapter 1: Exam Overview & Observability Foundations

1.1 OTCA Exam Structure & Observability Paradigms 1.2 Core Telemetry Signals: Traces, Metrics, Logs & Baggage 1.3 Telemetry Analysis, SLOs & High Cardinality

2 Chapter 2: Semantic Conventions & Instrumentation Strategy

2.1 OpenTelemetry Semantic Conventions & Namespaces 2.2 Resource Attributes & Entity Modeling 2.3 Zero-Code vs Code-Based Instrumentation

3 Chapter 3: OpenTelemetry Architecture & The Data Model

3.1 Architectural Separation of API and SDK 3.2 The Core Trace Model: Spans, SpanContext & Links 3.3 Span Events, Attributes & Status Codes 3.4 Composability & Extension: Plugin Interfaces, Distributions & Contrib

4 Chapter 4: Distributed Tracing & Context Propagation

4.1 In-Process & Cross-Process Context Propagation 4.2 W3C Trace Context Specification 4.3 W3C Baggage & Alternative Propagators

5 Chapter 5: OpenTelemetry Metrics API & Instruments

5.1 Synchronous Metric Instruments 5.2 Asynchronous (Observable) Metric Instruments 5.3 Metric Aggregations & Temporality

6 Chapter 6: Logs Data Model & Logging Bridge API

6.1 OpenTelemetry Logs Data Model & Architecture 6.2 The Logging Bridge API & Log Appenders

7 Chapter 7: SDK Pipelines, Processors & Exporters

7.1 Span Processors & Exporters 7.2 Metric Readers & Log Processors 7.3 Standard Exporters & OTLP Wire Protocols

8 Chapter 8: Sampling Strategies, SDK Configuration & Agents

8.1 Head-Based Sampling & Built-in Samplers 8.2 Tail-Based Sampling vs Head-Based Sampling 8.3 OpenTelemetry SDK Configuration & Environment Variables 8.4 Zero-Code Agents: Configuration, Kubernetes Injection & Troubleshooting

9 Chapter 9: OpenTelemetry Collector Architecture & Pipelines

9.1 Collector Core Architecture & Component Lifecycle 9.2 Collector Configuration Structure & Pipelines 9.3 Essential Collector Extensions

10 Chapter 10: Collector Components: Receivers, Processors & Exporters

10.1 Standard Receivers & Ingestion Protocols 10.2 Core Processors & Execution Order 10.3 Standard Exporters & Delivery Guarantees

11 Chapter 11: Data Transformation & The OpenTelemetry Transformation Language (OTTL)

11.1 OTTL Concepts & Syntax Grammar 11.2 Transform Processor In Action 11.3 Advanced Connectors

12 Chapter 12: Collector Deployment, Scaling & Resilience

12.1 Agent vs Gateway Deployment Topologies 12.2 Scaling, Load Balancing & High Availability 12.3 Resilience: Backpressure, Buffering & Persistent Queues

13 Chapter 13: Maintaining, Debugging & Schema Evolution

13.1 Debugging Collector Pipelines & Telemetry Health 13.2 Troubleshooting Broken Traces & Context Loss 13.3 Schema Management & Telemetry Evolution

7.3 Standard Exporters & OTLP Wire Protocols

Key Takeaways Explain This Topic AI

OpenTelemetry Protocol (OTLP) is the purpose-built, vendor-agnostic wire protocol standardizing traces, metrics, and logs transmission using Protocol Buffers schema specifications.

OTLP/gRPC operates over HTTP/2 using default port 4317, providing binary serialization, multiplexed streaming, and high throughput for service-to-collector traffic.

OTLP/HTTP operates over port 4318, utilizing dedicated per-signal endpoints (/v1/traces, /v1/metrics, /v1/logs) with binary Protocol Buffers (application/x-protobuf, default) or JSON (application/json) payloads.

Standard non-OTLP exporters include ConsoleExporter for local debugging, InMemoryExporter for unit testing assertions, PrometheusExporter for pull-based scraping, and legacy Zipkin/Jaeger exporters.

Production OTLP exporters require secure transport configuration including TLS/mTLS certificates, header injection ( Authorization: Bearer <token> ), and payload compression (gzip) to optimize bandwidth.

Last updated: September 2026

7.3 Standard Exporters & OTLP Wire Protocols

Quick Answer: The OpenTelemetry Protocol (OTLP) is the standardized, vendor-neutral wire protocol designed specifically for transmitting traces, metrics, and logs with maximum efficiency and zero semantic loss. OTLP defines two primary transport bindings: OTLP/gRPC (running binary Protocol Buffers over HTTP/2 on default port 4317 ) and OTLP/HTTP (running binary Protobuf or JSON over HTTP/1.1 or HTTP/2 on default port 4318 ). OTLP/HTTP routes signals to explicit endpoint paths: /v1/traces , /v1/metrics , and /v1/logs . In addition to OTLP, the SDK provides standard built-in exporters such as ConsoleExporter (local stdout debugging) and InMemoryExporter (isolated unit test assertions).

Before OpenTelemetry established OTLP, the observability landscape suffered from extreme protocol fragmentation. Distributed tracing relied on Zipkin (JSON/Thrift over HTTP) or Jaeger (Thrift over UDP or gRPC). Metrics relied on Prometheus text exposition or OpenMetrics over HTTP. Logs were scattered across Syslog, fluent forwarders, and proprietary JSON lines. Each protocol had distinct data structures, preventing cross-signal correlation and forcing developers to run multiple agents and translation proxies.

OTLP solved this by providing a unified, high-performance data model built on Protocol Buffers v3 ( proto3 ) .

OTLP Transport Bindings & Default Ports

Default ports, transports, URL paths, and content types are worth memorizing:

Transport Binding Default Network Port Underlying Transport Supported Encodings Default Content-Type Signal Endpoint Paths

OTLP/gRPC 4317 HTTP/2 Binary Protocol Buffers ( proto3 ) application/grpc gRPC Service Methods (e.g., opentelemetry.proto.collector.trace.v1.TraceService/Export )

OTLP/HTTP (Protobuf) 4318 HTTP/1.1 or HTTP/2 Binary Protocol Buffers ( proto3 ) application/x-protobuf /v1/traces ; /v1/metrics ; /v1/logs

OTLP/HTTP (JSON) 4318 HTTP/1.1 or HTTP/2 JSON (Protobuf JSON mapping) application/json /v1/traces ; /v1/metrics ; /v1/logs

1. OTLP/gRPC (Port 4317)

OTLP/gRPC is widely used for service-to-Collector and Collector-to-Collector traffic. (For SDK exporters, the specification's default protocol is http/protobuf ; some SDKs keep grpc as their default for backward compatibility.)

HTTP/2 Transport: Operates over HTTP/2, enabling connection multiplexing (multiple concurrent trace, metric, and log export streams over a single long-lived TCP connection), binary framing, and header compression (HPACK).

Performance: Binary Protocol Buffers provide compact serialization and rapid deserialization with minimal CPU overhead.

RPC Semantics: Exports are defined as standard gRPC unary remote procedure calls:

  • Traces: opentelemetry.proto.collector.trace.v1.TraceService/Export
  • Metrics: opentelemetry.proto.collector.metrics.v1.MetricsService/Export
  • Logs: opentelemetry.proto.collector.logs.v1.LogsService/Export

Status Codes: Uses standard gRPC status codes ( OK , UNAVAILABLE , RESOURCE_EXHAUSTED , DEADLINE_EXCEEDED ).

2. OTLP/HTTP (Port 4318)

While gRPC is extraordinarily performant, many corporate environments restrict or block HTTP/2 gRPC traffic at network firewalls, corporate forward proxies, Web Application Firewalls (WAFs), Content Delivery Networks (CDNs), or serverless API gateways. For these environments, OpenTelemetry provides OTLP/HTTP on default port 4318 .

Explicit URL Endpoint Paths

Unlike gRPC which invokes service methods, OTLP/HTTP mandates specific URL endpoints based on the telemetry signal:

  • Traces: http[s]://<host>:<port>/v1/traces
  • Metrics: http[s]://<host>:<port>/v1/metrics
  • Logs: http[s]://<host>:<port>/v1/logs

When a developer configures a generic base endpoint (e.g., OTEL_EXPORTER_OTLP_ENDPOINT="http://collector:4318" ), the respective signal exporters automatically append the required /v1/traces , /v1/metrics , or /v1/logs paths. If an engineer specifies a signal-specific variable (e.g., OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://collector:4318/v1/traces" ), the SDK uses that exact path without modification.

Payload Encodings: Protobuf vs. JSON

OTLP/HTTP supports two payload encodings:

application/x-protobuf (Binary Protobuf, recommended default): The payload is serialized as raw binary Protocol Buffers. It offers nearly the same wire compression and CPU efficiency as gRPC while traversing standard HTTP/1.1 infrastructure.

application/json (Protobuf JSON Mapping): The payload is serialized as JSON formatted according to the canonical Protobuf-to-JSON mapping. While less efficient (noticeably larger on the wire and more expensive to parse), it is human-readable and invaluable for browser-based tracing (OpenTelemetry JavaScript in web clients) and network packet inspection.

Standard Non-OTLP Exporters

In addition to OTLP exporters, OpenTelemetry language SDKs package standard built-in exporters for testing, development, and legacy migration: +-----------------------------------------------------------------------------------+

  • | Standard OpenTelemetry Exporters |
  • +-----------------------------------------------------------------------------------+
  • | OTLP Exporters (gRPC & HTTP) --> Production telemetry transport to Collector |
  • | ConsoleExporter (Stdout) --> Local development, debugging, and sanity checks|
  • | InMemoryExporter --> Automated CI unit and integration testing |
  • | PrometheusExporter --> Pull-based metric scraping on /metrics |
  • | Legacy Exporters (Zipkin/Jaeger)--> Migration support (Jaeger natively uses OTLP) |
  • +-----------------------------------------------------------------------------------+
  • 1. ConsoleExporter (Stdout)

Prints serialized telemetry records directly to standard output ( stdout or stderr ) in human-readable text or JSON formatting.

Use Cases: Rapid local development, verifying that auto-instrumentation is generating spans, tutorial demonstrations.

Production Anti-Pattern: Never deploy ConsoleExporter to high-throughput production environments. Synchronously printing thousands of spans to stdout causes heavy CPU overhead, disk I/O contention on host log managers, and severe log pollution.

2. InMemoryExporter

Stores finished spans, metrics, or log records directly in an in-memory thread-safe array or list within the application process runtime.

Provides programmatic inspection methods (e.g., exporter.get_finished_spans() , exporter.clear() ).

Use Cases: Automated unit and integration test suites. In a CI/CD pipeline, an engineer can write tests asserting that invoking an order checkout API generates a span named process_order with attribute order.id = 1042 and StatusCode.OK , without spinning up an external network collector or mock HTTP server .

3. PrometheusExporter / PrometheusMetricReader

Implements the pull-based scrape interface described in Section 7.2. It converts internal SDK metric accumulators into Prometheus text or OpenMetrics format upon receiving an HTTP GET scrape request.

4. Legacy Exporters (Zipkin & Jaeger)

ZipkinExporter: Serializes spans into Zipkin v2 JSON format and posts them to Zipkin collectors (typically on port 9411 ).

JaegerExporter: Originally exported spans using Jaeger Thrift over UDP or gRPC. Note for Exam: Modern OpenTelemetry SDKs have deprecated native Jaeger exporters because Jaeger natively accepts OTLP on ports 4317 and 4318. Telemetry should be sent to Jaeger using standard OTLP exporters.

Security, Authentication, & Compression in Exporters

Production telemetry pipelines must meet enterprise security standards for encryption, authentication, and bandwidth optimization.

1. Transport Encryption: TLS and mTLS

By default, local development uses insecure plaintext connections ( insecure = true or http:// ). In production environments crossing VPCs or traversing the public internet, TLS is mandatory:

Standard TLS: The client verifies the collector's certificate authority (CA) certificate to ensure encryption and identity ( ca_file or certificate ).

Mutual TLS (mTLS): In zero-trust networks, the collector also validates the application client. The SDK must be configured with a client certificate ( cert_file or client_certificate ) and private key ( key_file or client_key ). The standard environment variables are OTEL_EXPORTER_OTLP_CERTIFICATE (trusted CA), OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE , and OTEL_EXPORTER_OTLP_CLIENT_KEY , each with per-signal variants.

2. Authentication Headers

When sending telemetry to a managed SaaS backend or authenticated collector gateway, the exporter must inject authentication tokens into outgoing RPC headers:

Bearer Tokens / API Keys: Configured in code or via standard environment variables: export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer eyJhbGciOi...,x-honeycomb-team=secret_key"

Signal-specific headers can also be defined: export OTEL_EXPORTER_OTLP_TRACES_HEADERS="x-tenant-id=tenant-alpha"

3. Payload Compression

Telemetry data—especially traces and logs—contains highly repetitive strings (attribute keys, resource names, URL paths, error messages). Compressing payloads dramatically reduces cloud egress costs and bandwidth usage:

Supported Compression: The OpenTelemetry specification standardizes on gzip compression (as well as none ).

Configuration: export OTEL_EXPORTER_OTLP_COMPRESSION="gzip"

Because telemetry is highly repetitive, gzip usually shrinks payloads substantially for a modest CPU cost; measure the ratio on your own data.

Comparison: OTLP/gRPC vs. OTLP/HTTP (Protobuf) vs. OTLP/HTTP (JSON)

  • Architectural Attribute OTLP/gRPC OTLP/HTTP (Protobuf) OTLP/HTTP (JSON)
  • Default Port 4317 4318 4318
  • Transport Layer HTTP/2 HTTP/1.1 or HTTP/2 HTTP/1.1 or HTTP/2
  • Payload Format Binary Protocol Buffers ( proto3 ) Binary Protocol Buffers ( proto3 ) JSON String Mapping
  • Content-Type Header application/grpc application/x-protobuf application/json
  • Wire Efficiency Highest (Binary + HTTP/2 HPACK) High (Binary protobuf) Low (Verbose text strings)
  • CPU Utilization Lowest (Optimized binary serialization) Low High (JSON string encoding/decoding)

Firewall / Proxy Traversal Challenging (Proxies often block HTTP/2 gRPC) Seamless (Standard HTTP POST) Seamless (Standard HTTP POST)

Streaming / Multiplexing Full multiplexing over single TCP socket Dependent on HTTP/2 support Dependent on HTTP/2 support

Debugging & Inspection Requires specialized tools (grpcurl, Wireshark) Requires protobuf schema decoding Human-readable in cURL, Postman, browser DevTools

Primary Production Use Containerized microservices, Collector-to-Collector Edge services, restrictive firewalls, serverless Web browsers, legacy proxies, debugging

SDK Environment Variable Reference for Exporters

The OpenTelemetry specification guarantees uniform configuration across all programming languages via standard environment variables: +-----------------------------------------------------------------------------------+

  • | Core OTLP Environment Variables |
  • +-----------------------------------------------------------------------------------+
  • | OTEL_EXPORTER_OTLP_ENDPOINT --> Base collector URL (e.g., http://otel:4317)|
  • | OTEL_EXPORTER_OTLP_PROTOCOL --> 'grpc', 'http/protobuf', or 'http/json' |
  • | OTEL_EXPORTER_OTLP_HEADERS --> Global key-value headers (Auth tokens) |
  • | OTEL_EXPORTER_OTLP_TIMEOUT --> Global timeout in milliseconds (default 10s|
  • | OTEL_EXPORTER_OTLP_COMPRESSION --> Compression algorithm ('gzip' or 'none') |
  • +-----------------------------------------------------------------------------------+
  • | Signal-Specific Override Variables |
  • +-----------------------------------------------------------------------------------+
  • | OTEL_EXPORTER_OTLP_TRACES_ENDPOINT --> e.g., http://otel:4318/v1/traces |
  • | OTEL_EXPORTER_OTLP_METRICS_ENDPOINT --> e.g., http://otel:4318/v1/metrics |
  • | OTEL_EXPORTER_OTLP_LOGS_ENDPOINT --> e.g., http://otel:4318/v1/logs |
  • +-----------------------------------------------------------------------------------+

Loading diagram... OpenTelemetry Exporter Routing & OTLP Transport Endpoints