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

Upgrade XRAY_SAMPLER to be more robust #112

Open
AsakerMohd opened this issue Sep 24, 2024 · 0 comments
Open

Upgrade XRAY_SAMPLER to be more robust #112

AsakerMohd opened this issue Sep 24, 2024 · 0 comments

Comments

@AsakerMohd
Copy link
Collaborator

In Otel Dotnet, the sampler runs immediately after an Activity (span) is started. This is before any instrumentation happens on the activity which means that important information such as the URLPath and the HttpMethod are not yet available to the sampler.

Currently, to get the xray sampler to work as expected, we run it a second time when we have http request information in the plugin. This is a short term solution. For a long term solution, we need to update the sampler itself instead of this package to be more robust and run only once according to spec.

For ASP.NET Core, we should have access to HttpContext.Current using Dependency Injection where we can extract the request as soon the activity starts and thus have access to required information for the sampler.

For ASP.NET (Framework/non core), the Otel upstream team has pushed code changes to make URLPath available right when the activity starts and there's another PR for HttpMethod. Once that PR is merged and released, we can update the sampler.

Creating this issue to track this change.

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

1 participant