Skip to content
Latchkey

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.

OpenTelemetry
failed to export traces: rpc error: code = DeadlineExceeded desc = context deadline exceeded

Common 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

  1. Wait for the collector to be healthy before producing telemetry.
  2. Confirm the protocol and port match (gRPC 4317 vs HTTP 4318).
  3. Raise the export timeout only if the path is otherwise correct.
.github/workflows/ci.yml
env:
  OTEL_EXPORTER_OTLP_TIMEOUT: '30000'  # ms

Match 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.

.github/workflows/ci.yml
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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →