1. Introduction to the OTLP protocol #
OpenTelemetry uses its own native protocol to send observability data (logs, metrics, traces) from your applications to a collector (such as the OpenTelemetry Collector or Grafana Alloy). This protocol is called OTLP (OpenTelemetry Protocol).
OTLP vs OTel: clarification #
People often confuse the terms OTLP and OTel. OpenTelemetry (often abbreviated OTel) is the overall open source project that provides the APIs, SDKs and the Collector to instrument, generate, collect and export telemetry data.
OTLP (OpenTelemetry Protocol), on the other hand, is the specific communication protocol defined by the OpenTelemetry project to carry this telemetry data in a standardized, efficient way. In other words, OTLP is a fundamental part of OpenTelemetry: the 'language' OTel components use to exchange information.
Transport and encoding #
OTLP defines both how data is encoded and how it is carried over the network. OpenTelemetry specifies two main transport mechanisms:
- OTLP/gRPC: uses gRPC over HTTP/2.
- OTLP/HTTP: uses standard HTTP (1.1 or 2) requests (usually encoded in Protobuf, sometimes in JSON).
Understanding the difference between these two transport methods is essential to design resilient, high-performing observability architectures.
2. OTLP over gRPC (default port: 4317) #
gRPC (gRPC Remote Procedure Calls) is an open source framework developed by Google. It is designed for communication between microservices and offers extremely high performance.
Advantages of gRPC #
- Optimal performance: natively built on HTTP/2, gRPC supports multiplexing. Several requests (streams) can be sent simultaneously over a single TCP connection, significantly reducing latency.
- Binary efficiency: gRPC always uses Protocol Buffers (Protobuf) to encode data in binary form. The payload is very compact compared with plain text.
- Persistent connections: streams are kept open, avoiding the cost of repeated TCP/TLS setup (TCP handshake) for every data send.
Drawbacks of gRPC #
- Crossing complex networks: many firewalls, WAFs or older L7 load balancers handle long-lived HTTP/2 streams poorly or block gRPC. If a single device along the network path does not support HTTP/2, the connection fails.
- Difficult debugging: since packets are exchanged in compressed binary form through streams, you cannot read intercepted data with a simple network analyzer without specific protobuf decoding tools.
Examples of common error messages #
One of the most frequent errors when configuring an OTLP/gRPC exporter is pointing it at an endpoint that expects HTTP/1.1 traffic. This produces a protocol negotiation (ALPN) error during the TLS handshake.
no more retries left: rpc error: code = Unavailable desc = connection error: desc = \"transport: authentication handshake failed: credentials: cannot check peer: missing selected ALPN property. If you upgraded from a grpc-go version earlier than 1.67, your TLS connections may have stopped working due to ALPN enforcement. For more details, see: https://github.com/grpc/grpc-go/issues/434\"This message means the client (your exporter) tried to establish a secure connection using HTTP/2 (required by gRPC), but the destination server did not confirm that it supports this protocol. This typically happens if you send gRPC data (port 4317) to an endpoint configured to listen for HTTP (port 4318).
3. OTLP over HTTP (default port: 4318) #
OTLP over HTTP uses standard POST requests to a specific endpoint (e.g./v1/traces, /v1/metrics). The request body can be encoded in Protobuf (the most common) or in JSON.Advantages of HTTP #
- Universal compatibility: standard HTTP traffic (HTTP/1.1 or HTTP/2) goes through any load balancer, NGINX, HAProxy, Kubernetes Ingress Controller or firewall.
- Easy testing: it is very simple to send fake traces or test connectivity with standard tools such as
curlor Postman, especially with JSON encoding. - Frontend / browser environments: web browsers block or handle pure gRPC communication very poorly. Sending telemetry from a frontend SDK is almost always done with OTLP/HTTP.
Drawbacks of HTTP #
- Overhead: without gRPC's persistence and smooth multiplexing, OTLP/HTTP may need to reopen TCP/TLS connections more often (although Keep-Alive helps mitigate this).
- Slightly higher consumption: processing a large number of independent HTTP requests creates a slight CPU and memory overhead on the collector compared with native gRPC streaming.
4. Practical configuration: the Alloy example #
In practice, it is very simple to configure a collector such as Grafana Alloy or an OTel Collector to use one or the other.
4.2 Configuring Alloy as a receiver #
To receive OTLP data, Alloy uses the otelcol.receiver.otlp component. It can listen on both protocols simultaneously to accommodate all your sources:
otelcol.receiver.otlp "default" {
grpc {
endpoint = "0.0.0.0:4317"
}
http {
endpoint = "0.0.0.0:4318"
}
output {
metrics = [otelcol.processor.batch.default.input]
logs = [otelcol.processor.batch.default.input]
traces = [otelcol.processor.batch.default.input]
}
}TIP: In this configuration, Alloy accepts gRPC streams on port 4317 and HTTP streams on port 4318. The data is then passed to a batch processor before being sent to your backends.
4.1 Configuring Alloy as an exporter #
Here is how to send data over gRPC and then over HTTP in a Grafana Alloy configuration:
// 1. Export OTLP via gRPC (port 4317)
otelcol.exporter.otlp "grpc_backend" {
client {
endpoint = "otel-gateway.rousseltm.interne:4317"
tls {
insecure = true // Seulement en réseau privé de confiance !
}
}
}
// 2. Export OTLP via HTTP (port 4318)
otelcol.exporter.otlphttp "http_backend" {
client {
endpoint = "https://otel-gateway.rousseltm.interne:4318"
}
}5. Conclusion: which one should you choose? #
The choice between gRPC and HTTP for OpenTelemetry depends mainly on your network topology.
Summary table #
| Criterion | OTLP / gRPC (port 4317) | OTLP / HTTP (port 4318) |
|---|---|---|
| Format | Binary (Protobuf) | Protobuf or JSON |
| Performance & throughput | Very high (multiplexing) | Medium to high |
| Latency | Very low | Higher (HTTP overhead) |
| Connection | Persistent (continuous streams) | Independent requests (Keep-Alive) |
| Network compatibility | Requires end-to-end HTTP/2 | Universal (HTTP/1.1 & HTTP/2) |
| Proxy / LB support | Sometimes complex | Excellent (web standard) |
| Firewall / WAF support | Often inspected or blocked | Generally allowed |
| Debugging | Complex (requires dedicated tools) | Easy (cURL, Postman, browser) |
When to use gRPC? #
Use gRPC (4317) by default when communication stays internal to your data center or Kubernetes cluster. It is the highest-performing choice for backend-to-backend communication, between your microservices and your local collector (agent/DaemonSet), or between collectors.
When to use HTTP? #
Use HTTP (4318) when your observability data must cross a public network, a corporate firewall, or a cloud L7 load balancer (such as AWS ALB) that handles end-to-end HTTP/2 poorly, or when telemetry comes from a web browser or a mobile application.
Illustration #

6. Frequently asked questions (FAQ) #
Answers to your most frequent questions about OTLP.
What is OTLP, explained simply? #
OTLP (OpenTelemetry Protocol) is a standard, vendor-neutral, open source communication protocol. It acts as a common language to carry your logs, metrics and traces from your applications to any compatible observability system.
7. Take the next step #
Discover our courses dedicated to observability and OpenTelemetry.
Continue learning #
To master the collection, transformation and export of your telemetry data end to end, get hands-on with our specialized courses:
Related articles:
Also read our complete guide to Grafana Alloy to go further with data collection.
2026 update: what has changed #
Recent changes worth knowing (checked in November 2026).
OTLP in 2026 #
- OTLP traces, metrics and logs are stable; the fourth signal, profiles, entered public alpha in March 2026 (Collector v0.148 or later). Do not use it for critical data yet: its format is still changing.
- SDK declarative configuration (one YAML file instead of dozens of environment variables) has a stable 1.0 schema; support varies by language.
- Ports 4317 (gRPC) and 4318 (HTTP) remain the norm, and more and more backends (Prometheus 3, Loki 3, Tempo, Elastic, Dynatrace) accept OTLP directly, with no tool-specific exporter.
# Check that an OTLP/HTTP endpoint answers (an empty request gets an empty response, not an error)
curl -s -X POST http://localhost:4318/v1/traces -H 'Content-Type: application/json' -d '{}' -w '%{http_code}\n'My progress
Sign in to track your progress and take notes. Sign in
💬 Recent discussions about this course
- Alloy : recevoir de l'OTLP et l'envoyer vers Tempo et Mimir✓ solved · 1 reply(ies)
Ask a question about this lesson →See all discussions about this course
Course Glossary
Grafana Alloy
An open-source, vendor-neutral telemetry collector designed to replace Grafana Agent, fully compatible with OpenTelemetry (OTel).
Recommended Articles
Grafana Alloy vs OpenTelemetry Collector: Which One Should You Choose?
A detailed comparison between Grafana Alloy and the OpenTelemetry Collector. Discover the strengt...
Grafana Alloy: collecting and transforming telemetry
Learn how to use Grafana Alloy to collect, transform and route logs, metrics and traces. Discover...
Grafana Alloy: Metrics Collection (Prometheus & Ecosystem)
Learn how to configure Grafana Alloy to collect, transform, and forward metrics using the Prometh...
Grafana Alloy best practices: optimizing your telemetry collection
Discover the golden rules for configuring Grafana Alloy robustly: modularity, secrets management,...
Grafana Alloy environment variables: GOMEMLIMIT, sys.env and OTEL_RESOURCE_ATTRIBUTES
Which variables does Grafana Alloy actually read? GOMEMLIMIT, HTTP_PROXY, sys.env, OTEL_RESOURCE_...
OpenTelemetry architecture: understanding the 3 levels
A deep dive into the OpenTelemetry architecture. Learn how data flows from the application to the...
OpenTelemetry metrics: instruments, temporality, histograms and exemplars
Master the metric signal: MeterProvider, synchronous and asynchronous instruments (Counter, UpDow...
Grafana Alloy: collecting system metrics and local logs
Learn how to configure Grafana Alloy to monitor the server it runs on, with a focus on configurat...
Grafana Alloy vs Grafana Agent vs Promtail: which one to choose?
Discover how telemetry collectors have evolved in the Grafana ecosystem. A detailed comparison of...