mirror of
https://github.com/temporalio/temporal.git
synced 2026-08-30 18:41:49 -07:00
## What changed? <!-- Describe what has changed in this PR --> - allow configuring a custom OTEL `service.name` prefix - allow configuring an OTEL exporter via env vars (following the [OTEL spec](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options)) **Note that the OTEL exporter from the environment variables will only be created if there isn't already one from the config.** Creating an additional one wouldn't make any sense since the env variables would be applied to both anyways and there would not be any difference between them. ## Why? <!-- Tell your future self why have you made these changes --> Addresses: - https://github.com/temporalio/temporal/issues/4042 - https://github.com/temporalio/temporal/issues/4041 - our own (increasing) need to enable OpenTelemetry tracing without touching the Server config (for ad-hoc debugging when working on a SDK, for example) ## How did you test it? <!-- How have you verified this change? Tested locally? Added a unit test? Checked in staging env? --> I ran an OTEL collector to verify it sends the tracing exports. These are the env vars I set to make it work: ```go os.Setenv("OTEL_TRACES_EXPORTER", "oltp") os.Setenv("OTEL_EXPORTER_OTLP_TRACES_INSECURE", "true") ``` ## Potential risks <!-- Assuming the worst case, what can be broken when deploying this change to production? --> I doubt anyone would accidentally have these env variables specified and turn on OpenTelemetry by accident. Unless these are specified; no behavior change occurs. ## Is hotfix candidate? <!-- Is this PR a hotfix candidate or does it require a notification to be sent to the broader community? (Yes/No) --> No