otel-cli icon indicating copy to clipboard operation
otel-cli copied to clipboard

support standard OpenTelemetry envvars where appropriate

Open tobert opened this issue 4 years ago • 3 comments

via @ahayworth, otel-cli should support the standard envvars that make sense

https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md

tobert avatar Apr 01 '21 19:04 tobert

Supporting more Otel Auto Configurer environment variables would be great.

Here are some environment variable that look particularly valuable when integrating the otel-cli with the Jenkins OpenTelemetry Plugin so that Jenkins pipeline sh steps could invoke the otel-cli transparently passing all the context and settings via environment variables:

Environment variable  Value when used with the Jenkins OpenTelemetry Plugin Comments
OTEL_SERVICE_NAME Name of the service, default is "jenkins", can be customized in the Jenkins configuration I'm not clear why the otel-cli preferred to use OTEL_CLI_SERVICE_NAME rather than OTEL_SERVICE_NAME
OTEL_RESOURCE_ATTRIBUTES  Attributes characterizing the Jenkins instance, primarily jenkins.url
OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS... Defined in the Jenkins config screen Most of them seem to be already supported, see Otel Specs > OpenTelemetry Protocol Exporter

cyrille-leclerc avatar Jun 17 '21 21:06 cyrille-leclerc

With #35 merged I can finally start writing tests that validate envvar configs in a system test, so I'll be working on this in the next few days.

tobert avatar Aug 18 '21 22:08 tobert

@cyrille-leclerc iirc I chose OTEL_CLI_SERVICE_NAME because I wasn't aware of the otel specs for envvars at that point.

I did some testing tricks in https://github.com/equinix-labs/otel-init-go/pull/2 that I will port over here so we can not only add the envvars but test that they're working right. That can come after the initial changes to align with the otel specs though.

tobert avatar Aug 24 '21 17:08 tobert

Any updated on that?

spuliaiev-sfdc avatar Feb 14 '23 17:02 spuliaiev-sfdc

@spuliaiev-sfdc as of PR #120 things should be in good shape. I'm not aware of any envvars that don't match the specs. There are also now tests in place that check the vars all the way through otel-cli to the server.

Please let me know if there's something important to you that's missing!

tobert avatar Feb 14 '23 19:02 tobert

Am I missing the change to read OTEL_SERVICE_NAME when OTEL_CLI_SERVICE_NAME is not provided?

spuliaiev-sfdc avatar Feb 15 '23 17:02 spuliaiev-sfdc

@spuliaiev-sfdc you're right, that needs fixed. I've started on #158.

tobert avatar Feb 15 '23 20:02 tobert

This should be resolved as of v0.3.0. There's more opportunity to use service attribute autodetection but that's a topic for antoher issue. Please open a new issue for envvars you need that aren't supported yet.

tobert avatar Jun 13 '23 16:06 tobert