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

Inter-process propagation of traceparent #602

Open
akselleirv opened this issue Feb 4, 2024 · 4 comments
Open

Inter-process propagation of traceparent #602

akselleirv opened this issue Feb 4, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@akselleirv
Copy link

akselleirv commented Feb 4, 2024

I'm running an application which executes another local binary and I want to propagate the trace context to the new binary. Currently Beyla starts a new trace for every span.

I found some earlier discussion for this use-case here: open-telemetry/opentelemetry-specification#740

Would that be something Beyla could support?

@grcevski
Copy link
Contributor

grcevski commented Feb 5, 2024

Hi @akselleirv,

The short answer is Yes and No :)., depending on which programming language is your application written in.

Beyla 1.2

  • For Go application, Beyla version 1.2 will propagate the context and we fully support distributed traces for HTTP and gRPC.
  • There's no support for context propagation for other languages in Beyla 1.2

Main

  • Beyla now supports context propagation for HTTP2 on Go.
  • We have new context propagation method which we call blackbox context propagation which works for any programming language with some limitations:
    • We don't support NodeJS well, because of how it internally handles the request processing.
    • We can't propagate context if the application is using reactive async libraries and thread pools
    • We require that a single Beyla monitors all processes that are traced.

If you share with us your exact usecase, and for non-Go applications if you are running the applications on the same node I think we can make it work with our main branch.

Sorry for the delayed response, all of us were at FOSDEM until today.

@akselleirv
Copy link
Author

Hello @grcevski,

Sorry for not explaining my use-case in more detail. What I'm trying to do is to add insights into tf-controller which can be achieved with manual instrumentation of the code. Where I currently lack insights is when the tf-controller starts a pod, called tf-runner, which executes the Terraform CLI locally.

I was successful of instrumenting the Terraform binary with Beyla, but it is missing the parent context from the tf-runner to the Terraform binary. It seems like one convention to propagate the trace context to a local binary is to set an environment variable like TRACECONTEXT and/or TRACEPARENT, and then in the binary lookup these environment variables and use them as the parent trace.

Would it be possible for Beyla to lookup the environment variables for the process and use the TRACEPARENT as the parent trace if it did not find any by for example introspecting the HTTP header.

@grcevski
Copy link
Contributor

grcevski commented Feb 6, 2024

Hi @akselleirv,

We can't do this yet, but it's possible to do. We currently track executable launches with Beyla so we can instrument them, so we can at the point of execve read the process environment variables and pick out the TRACEPARENT.

I've linked our short-lived processes task because it's relevant, we'll add this support in that context.

@grcevski grcevski added the enhancement New feature or request label Feb 6, 2024
@grcevski grcevski self-assigned this Feb 6, 2024
@akselleirv
Copy link
Author

That would be awesome! Thanks for the quick replies.

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

No branches or pull requests

2 participants