-
Notifications
You must be signed in to change notification settings - Fork 621
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
Request ASGI attributes passed to Sampler #1762
Request ASGI attributes passed to Sampler #1762
Conversation
Could you update the tests? The attributes are changed so the expected attributes in tests should be updated too |
Hi @shalevr, the final span attributes are the same before and after the code update. The tests in |
Head branch was pushed to by a user without write access
I've added 7d91b86 to fix a failed test in the
This seems to have fixed the
|
@srikanthccv @shalevr any chance we can get this merged in soon? |
Description
This adds HTTP server request attributes to the ASGI instrumentation library's start_span call, making them available to otel sampler's should_sample method. A very basic example:
Before this change,
attributes
is None. After this change,attributes
for an instrumented ASGI app would be:Fixes #1752
Type of change
How Has This Been Tested?
I have a custom distro that configures the attribute-logging sampler code in the above Description. On my local I run a FastAPI app with
opentelemetry-instrument
after local install ofopentelemetry-instrumentation-asgi==0.39b0.dev
and its dependencies. Then Icurl
the app's/healthcheck
route to see stdout logs of the attributes.Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.