-
Notifications
You must be signed in to change notification settings - Fork 889
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
Environment Variables as Carrier for Inter-Process Propagation to transport context #740
Comments
FYI an ecosystem of CI/CD platforms and tools is rapidly growing around propagation of Otel trace contezxt using the Existing integrations of CI/CD tools using OpenTelemetry trace context propagation through environment variables (
cc @tobert , @v1v, @kuisathaverat |
I am the author of https://github.com/equinix-labs/otel-cli and have been using TRACEPARENT propagation over envvars for a few months now. We're doing this work in production at Equinix Metal, and I believe a few others are using otel-cli in production now including GitHub. Please let me know how I can help make this OTEP happen. |
Hi, we have developed a propagator that helps propagate trace/baggage details across processes using environment variable as the carrier. It supports different formats for the trace details (b3/w3c/ some custom format). I am author of https://github.com/Div95/opentelemetry-python/tree/feature/env_propagator/propagator/opentelemetry-propagator-env which has this solution in Python language. We'd like to help move this issue forward. |
@cyrille-leclerc you mention |
Thanks to @tonistiigi in rakyll/go-test-trace#2 I have learned that Buildkit uses |
@aidansteele Indeed, these are exposed to every process running in Dockerfile |
Traceparent and Tracestate from W3C Trace Context specification are not a part of OTel. W3C Trace Context is a standalone spec, Otel is one of the implementors. If we choose to prefix things with OTEL_, it'd not be great for other instrumentation libraries that want to provide propagation via environmental variables. They will eventually came up with their own and it will fragment the space. It'd be better if we don't tightly couple the environment variable name with OTel, but I agree that TRACEPARENT and TRACESTATE are not specific enough. |
cc @nachoBonafonte @SergeyKanzhelev (from the EnvironmentContextPropagator implementation) |
otel-cli is using curl -H "traceparent: ${TRACEPARENT:-}" $url Maybe I'm too deep into this stuff and acclimated to the variable names, but this reads well and looks obvious in the code I've submitted to various projects. Making the variable names longer would make it a bit more awkward to inject this into existing code and the mismatched header/variable name feels wrong to me. |
They seem no more or less specific than the respective HTTP headers. @rakyll do you have some specific downsides in mind from using these as is, in accordance with the W3C spec for http headers?
On the other hand, I am not aware of any standards body that can bless the name of an environment variable. My vote is to use TRACEPARENT and TRACESTATE, and optionally provide a config capability in the propagator to override the names should some users come across naming conflicts. |
Using TRACEPARENT and TRACESTATE felt natural when we built the Jenkins OpenTelemetry Plugin and the OpenTelemetry Maven Extension and it seamlessly integrated with @tobert's The integration using TRACEPARENT and TRACESTATE was so simple and so intuitive that we realized the potential Otel has to provide observability on the whole CI/CD toolchain. It would be great if we could just use those environment variables and, as @yurishkuro said, optionally support specifying alternate environment variables. |
Headers are scoped to a request, environmental variables are scoped to the environment and has a larger radius. That's where my worry is coming from. We are using TRACEPARENT right now in go-test-trace, rakyll/go-test-trace@2249361. |
Hi, in |
FYI Concourse CI also uses the TRACEPARENT environment variable for context propagation. I have just submitted a PR on the Concourse CI documentation to make it clear: concourse/docs#462 |
It seems we have a general consensus on using TRACEPARENT/TRACESTATE unadorned. I'd say it's safe to move to creating a PR to reflect this in the spec. |
The Opentelemetry callback plugin for Ansible also uses |
Is anyone working on a PR for this change to the spec (or planning to work on one)? If not, I'm happy to work on a PR. I'm very new to OpenTelemetry, so if there is anyone who would like to volunteer to answer some questions (if needed) and do an initial review, that would be great for this newb. |
Are there any relevant solutions for other compiled languages? We use dotnet and azure devops server CI pipeline. |
Thanks @wajika
We see initiatives to instrument unit tests (using the JUnit report format) and progress on BuildKite (here) but unfortunately I'm not aware of progress on the .Net / Azure ecosystem yet. |
Hello, For context I'm just using a W3CTraceContextPropagator (W3CTraceContext documentaion). The Jenkins OpenTelemetry Plugin seems to provide the TRACECONTEXT / TRACESTATE variable (upper cased). When I inject the current context into a map like so:
it results in a tracecontext / tracestate variable (lower cased). Since environment variables are case sensitive and the W3CTraceContext documentaion refers to them as only lower cased: Should this be considered a bug in the Jenkins OpenTelemetry Plugin, or is perhaps worth to discuss in this more broader context, since it can affect any other Inter-Process Carrier Propagation? |
hi @stmlange, my understanding is that W3CTraceContext is only about propagating over HTTP headers my suggestion in your code above would be to have your |
@yurishkuro said awhile back:
I'm curious if this would count as a "Yes" per this:
-- source If not, what is the right path to get to a Yes (or No, etc.) for this issue? |
@deejgregor yes, I believe we have the agreement, and judging by the number of different PRs linked to this issue there are plenty of implementations that already use this approach. Are you willing to create an OTEP PR? In it I would cover
|
Yup! Finally... after first aiming to do this in late 2021, heh. I've started researching, and I'll make sure the items you mentioned are included. I've noticed one interesting thing so far: we aren't terribly explicit in the spec about how we propagate other than mentioning the propagation distributions, which mostly cover how to encode in HTTP (request) headers and not much else (in the case of B3, it does mention what to do for gRPC and JMS) . The trace semantic conventions for messaging have probably the most explicit mention of how to attach the context information, if only to say it isn't explicitly covered yet. ;-)
-- source |
I've also added |
Really glad to see this getting traction. Appreciate it. Thanks.
…On Wed, Nov 15, 2023, 8:40 PM Kristof Kowalski ***@***.***> wrote:
I've also added TRACEPARENT injection to the shell in
https://github.com/krzko/run-with-telemetry, which compliments the New
component: Github Actions Event Receiver
<open-telemetry/opentelemetry-collector-contrib#27460>
issue.
—
Reply to this email directly, view it on GitHub
<#740 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABPDLPTCUTK2LU6Q5BXMLODYEWDK3AVCNFSM4PHO6QTKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBRGM3TIMJTGU3A>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Seems to be related: #3825, if you consider inter-process to be a "client" |
This is related to open-telemetry/oteps#258. @adrielp just making you aware as you raised the OTEP PR |
@carlosalberto @yurishkuro as I've seen you commented on the OTEP PR linked above, are any of you sponsoring this? |
This OTEP attempts to address the usage of TRACEPARENT and TRACESTATE environment variables as a means to propagate tracing context to subprocesses. Such usage is already implemented by various tools in the wild, and has essentially become a de facto standard. open-telemetry/opentelemetry-specification#740 This aims to replace an earlier OTEP 258 which appears to have stalled. While the core idea presented is the same, this OTEP has a slightly narrow scope, and do not derive from OTEP 258 or its unpublished predecessor OTEP 241.
Passing context information while a process being spawn as part of a span using a shell script or process builders.
Propagating context information while creating a process for another process, to trace the lineage, there isn't any protocol such as Http/gRPC to transport context. A common way to pass information using Environment Variables, which shall be utilized as a carrier.
Environment variables have differences between the operating systems, such as case sensitivity in Linux and case insensitivity in windows.
Defining specification/guidance, to have a common format and method for propagation using Environment Variables, will be solving many ETL tools and batch cases.
The text was updated successfully, but these errors were encountered: