Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document go-test-trace global trace context propagation to go test #2

Open
rakyll opened this issue Sep 21, 2021 · 4 comments
Open

Comments

@rakyll
Copy link
Owner

rakyll commented Sep 21, 2021

Currently, go-test-trace propagates the global context to go test via TRACE_CONTEXT environmental variable, but this feature is not documented and it's not clear what the limitations are.

@tonistiigi
Copy link

tonistiigi commented Sep 21, 2021

Buildkit supports OTEL_TRACE_PARENT OTEL_TRACE_STATE for propagation https://github.com/moby/buildkit/blob/44891f4cb975ac70d62d40139ba819fe855da59c/util/tracing/env/traceenv.go#L21-L23 https://github.com/moby/buildkit/blob/44891f4cb975ac70d62d40139ba819fe855da59c/util/tracing/exec/traceexec.go#L23-L29 . It isn't my invention and there is prior tooling but not spec atm. @Aneurysm9 seemed ok for making something like this at least semi-official.

The grpc endpoint address in env is defined in spec though https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options and is automatically supported by library but I think the way endpoint is overwritten from a flag disables this behavior https://github.com/rakyll/go-test-trace/blob/main/main.go#L63

@aidansteele
Copy link

See also open-telemetry/opentelemetry-specification#740.

There's a few examples of tools that have settled on TRACEPARENT and TRACESTATE environment variables. TIL that Buildkit also has environment variable support.

Maybe it would be worth weighing in there as it seems there is some growing effort towards standardising? It would be great if this Just Worked™ out of the box.

@rakyll
Copy link
Owner Author

rakyll commented Sep 21, 2021

Once open-telemetry/opentelemetry-specification#740 is settled, I'm happy to adopt what's there. I agree that standardization is useful, so we have the primitive utilities for propagation available in every language.

rakyll added a commit that referenced this issue Sep 22, 2021
To be more aligned with other ecosystem tools. We will switch to the environmental variable designated by OpenTelemetry.

Related to #2.
@rakyll
Copy link
Owner Author

rakyll commented Sep 22, 2021

Switched to TRACEPARENT interim, let's adjust it to whatever open-telemetry/opentelemetry-specification#740 ends up choosing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants