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

Documentation improvement - Distributed tracing - Elastic APM #2372

Open
tomap opened this issue Jan 9, 2024 · 1 comment
Open

Documentation improvement - Distributed tracing - Elastic APM #2372

tomap opened this issue Jan 9, 2024 · 1 comment
Labels
help wanted We will welcome a contribution Type: Documentation Improvements or additions to documentation
Milestone

Comments

@tomap
Copy link

tomap commented Jan 9, 2024

Hello,

I cam across an issue where Elastic APM was not able to link the calls between my BFF (using Yarp) and my backend

I tried to follow the suggestion here:
https://microsoft.github.io/reverse-proxy/articles/distributed-tracing.html#pass-through-proxy

but it did not help

But by following the suggestion from Elastic Team:

https://discuss.elastic.co/t/elastic-apm-yarp/347667/2

It worked!
Here is the code that I used in the end:

builder.Services.AddReverseProxy()
    .LoadFromConfig(builder.Configuration.GetSection("ReverseProxy"))
    .ConfigureHttpClient((context, handler) => handler.ActivityHeadersPropagator = DistributedContextPropagator.CreateDefaultPropagator());

You could add it to the documentation just in case of similar issue

Thank you

@tomap tomap added the Type: Feedback This issue is general feedback and doesn't represent actionable work. label Jan 9, 2024
@MihaZupan MihaZupan added Type: Documentation Improvements or additions to documentation and removed Type: Feedback This issue is general feedback and doesn't represent actionable work. labels Jan 9, 2024
@MihaZupan
Copy link
Member

Thanks for the report. It appears Elastic's .NET integration is relying on the existing header being set on the request, and not on the ambient Activity. This is unlike other integrations we've tested against.

I don't believe there's much we can do by default that would work for both scenarios.
Documenting that changing ActivityHeadersPropagator back to default works for Elastic in the existing tracing doc makes sense.

@MihaZupan MihaZupan added this to the Backlog milestone Jan 9, 2024
@MihaZupan MihaZupan added the help wanted We will welcome a contribution label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We will welcome a contribution Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants