odigos-io / opentelemetry-go-instrumentation

OpenTelemetry auto-instrumentation for Go applications
Apache License 2.0
292 stars 44 forks source link

Use OTEL SDK to parse exporter endpoint #21

Open pavolloffay opened 2 years ago

pavolloffay commented 2 years ago

Feature request

The exporter endpoint is not parsed directly in the code https://github.com/keyval-dev/opentelemetry-go-instrumentation/blob/master/pkg/opentelemetry/controller.go#L76 from which grpc connection is created.

This is not ideal because it limits how the exporter is initialized and it breaks semantics of OTEL_EXPORTER_OTLP_ENDPOINT which should have form of http(s)://host:port. See https://github.com/open-telemetry/opentelemetry-go/tree/main/exporters/otlp/otlptrace and OTEL spec.

I would propose to change the code to consume only env vars in OTEL defined format and leave parsing of the endpoint to OTEL SDK/exporter implementation.