elastic / apm-agent-go

https://www.elastic.co/guide/en/apm/agent/go/current/index.html
Apache License 2.0
413 stars 190 forks source link

Add configuration bridge to use otel with the elastic environment variables #1619

Open dmathieu opened 2 months ago

dmathieu commented 2 months ago

Is your feature request related to a problem? Please describe.

Open-source packages currently using this agent recommend customers to use environment variables to configure their instrumentation. See https://www.elastic.co/guide/en/apm/agent/go/current/configuration.html

We should allow those packages to migrate to otel with no breaking changes. So we should be able to configure otel with the elastic environment variables.

Describe the solution you'd like

A configuration tool, either part of apmotel, or within a new package that would read the elastic documented environment variables, and configure OpenTelemetry with those.

Note: there will still be a change there, as OpenTelemetry doesn't support the Elastic APM protocol, only OTLP.

jsoriano commented 2 months ago

Note: there will still be a change there, as OpenTelemetry doesn't support the Elastic APM protocol, only OTLP.

Good point. Given this, would still be worth to support migrating with the Elastic environment variables?

dmathieu commented 2 months ago

I think it still may make sense. apm-server does support OTLP. So as long as we document that services can only communicate with recent apm-servers (7.14 and higher it seems), switching to OTLP should be transparent.