Skip to content
Latchkey

OTEL_EXPORTER_OTLP_ENDPOINT "no such host" in CI

The OTLP exporter could not resolve the hostname in OTEL_EXPORTER_OTLP_ENDPOINT: DNS returned "no such host." Unlike connection refused, the dial never even reached an IP because the name does not resolve.

What this error means

Logs show "dial tcp: lookup otel-collector on ...: no such host" or "no such host" from the exporter, and no telemetry is delivered.

OpenTelemetry
failed to upload metrics: Post "http://otel-collector:4318/v1/metrics":
dial tcp: lookup otel-collector on 127.0.0.11:53: no such host

Common causes

The service name is not resolvable from this job

A service hostname like otel-collector only resolves on the same Docker network; a job not attached to that network cannot look it up.

A typo or wrong scheme in the endpoint

A misspelled host, a missing scheme, or a stale endpoint value makes DNS resolution fail outright.

How to fix it

Use a hostname the runner can resolve

  1. For a service container, attach the job to the same network and use the service alias.
  2. For an external collector, use its real DNS name or IP.
  3. Re-run and confirm the lookup succeeds.
.github/workflows/ci.yml
services:
  otel-collector:
    image: otel/opentelemetry-collector:latest
    ports: ['4318:4318']
# then export to the published port:
env:
  OTEL_EXPORTER_OTLP_ENDPOINT: http://localhost:4318

Correct the endpoint value

Include the scheme and the exact host, e.g. http://host:4318, so DNS has a valid name to resolve.

How to prevent it

  • Reference collectors by names the runner can actually resolve.
  • Include the scheme and port in the OTLP endpoint.
  • Use published ports on localhost when a service container is involved.

Frequently asked questions

What causes ""no such host" (OTLP endpoint)"?
A service hostname like otel-collector only resolves on the same Docker network; a job not attached to that network cannot look it up.
How do I fix "no such host" (OTLP endpoint)?
Use a hostname the runner can resolve

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card