OpenTelemetry "context deadline exceeded" to the collector in CI
An OTLP export did not complete within its timeout, so the gRPC call returns DeadlineExceeded ("context deadline exceeded"). The collector was reachable enough to attempt the call but did not respond in time, often a slow, blocked, or misconfigured endpoint.
What this error means
The exporter logs "rpc error: code = DeadlineExceeded desc = context deadline exceeded" and telemetry is dropped after the timeout.
failed to export traces: rpc error: code = DeadlineExceeded desc = context deadline exceededCommon causes
The collector is slow or not fully ready
The endpoint accepts the connection but does not respond before the export timeout, often during startup or under load.
A blocked path or wrong protocol
A firewall, TLS mismatch, or sending gRPC to an HTTP-only port lets the dial start but never completes, so the call times out.
How to fix it
Ensure the collector is ready, then export
- Wait for the collector to be healthy before producing telemetry.
- Confirm the protocol and port match (gRPC 4317 vs HTTP 4318).
- Raise the export timeout only if the path is otherwise correct.
env:
OTEL_EXPORTER_OTLP_TIMEOUT: '30000' # msMatch TLS and protocol to the receiver
Use the insecure setting for a plaintext gRPC collector, or the right scheme for TLS, so the call can complete.
env:
OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4317
OTEL_EXPORTER_OTLP_INSECURE: 'true'How to prevent it
- Health-check the collector before exporting telemetry.
- Keep exporter protocol, port, and TLS aligned with the receiver.
- Set a realistic export timeout for the environment.