Skip to content

[otelconf] Cannot use IP address for GRPC endpoint without prepending http:// #7326

Open
@bacherfl

Description

@bacherfl

This issue is based of the discussion here: #7233 (comment)

When providing the otlpConfig.Endpoint with an IP address, rather than a hostname, e.g. 127.0.0.1:4317 instead of localhost:4317, the creation of the OTLP exporter will fail due to the endpoint not being parsed successfully (the error is returned bu the url.ParseRequestURI here:

u, err := url.ParseRequestURI(*otlpConfig.Endpoint)

The collector prevents this by automatically prepending http:// to the provided endpoint (https://github.com/open-telemetry/opentelemetry-collector/blob/main/service/telemetry/internal/migration/normalize.go#L8) before trying to create an exporter via otelconf, but other users of this library might run into this issue still

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: file-configRelated to file-based configurationbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions