Skip to content

[exporter/otlp] dns:/// scheme treated as passthrough since v0.141.0, breaking DNS-based load balancing #14372

@gimsesu

Description

@gimsesu

Component(s)

exporter/otlp

What happened?

Describe the bug

Since opentelemetry-collector v0.141.0, the dns:/// scheme in gRPC endpoints is no longer respected. The sanitizedEndpoint() function in configgrpc strips the dns:/// prefix before passing it to grpc.DialContext(), causing the endpoint to be treated as passthrough instead of using the DNS resolver.

This breaks DNS-based load balancing (e.g., round_robin with multiple IPs resolved from a single DNS name).

The root cause is in config/configgrpc/configgrpc.go:

  • Line 258-270: sanitizedEndpoint() strips the dns:/// prefix
  • Line 314: The stripped endpoint is passed to grpc.DialContext(), which defaults to passthrough resolver

Steps to reproduce

  1. Configure an OTLP exporter with DNS-based endpoint and load balancing:
    exporters:
      otlp:
        endpoint: dns:///my-service.example.com:4317
        balancer_name: round_robin
  2. The DNS name resolves to multiple IPs
  3. Observe that traffic only goes to one IP (passthrough behavior) instead of being distributed across all resolved IPs (DNS resolver behavior)

Workaround:
Use dns:///dns:/// as a prefix:

endpoint: dns:///dns:///my-service.example.com:4317

What did you expect to see?

The dns:/// scheme should be preserved and passed to gRPC, enabling the DNS resolver to resolve the hostname and provide all IPs to the load balancer for proper client-side load balancing.

What did you see instead?

The dns:/// prefix is stripped, causing gRPC to use the passthrough resolver. This results in connections going to only one IP, completely bypassing client-side load balancing.

Related PRs:

Collector version

0.142.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

exporters:
  otlp:
    endpoint: dns:///my-service.example.com:4317
    balancer_name: round_robin

Log output

Additional context

The deprecated grpc.DialContext treats bare hostnames as passthrough targets. The modern grpc.NewClient API properly parses URI schemes. PR #13663 addresses this but is blocked on test fixes.

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions