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

DjangoInstrumentor does not provide 'http.route', azure-monitor exporter does not export request path #1213

Closed
stschenk opened this issue Oct 7, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@stschenk
Copy link
Contributor

stschenk commented Oct 7, 2020

Describe your environment
python version: 3.7.3
opentelemetry-sdk version: v0.13b0
opentelemetry-instrumentation version: v0.13b0
opentelemetry-instrumentation-django version: v0.13b0
opentelemetry-azure-monitor version: v0.5.0

Steps to reproduce
Instrument django app with opentelemetry, opentelemetry-instrumentation-django, and opentelemetry-azure-monitor. Configure azure-monitor exporter with App Insights key.

Drive some traffic to your server.

You will see all request traces are grouped into 'overall' operation name.

I would expect to see traces group by the operation name such as GET /1/up, POST /1/user, ...

Looking through the code, I have found that opentelemetry-azure-monitor expects that a property 'http.route' or 'http.url' to have been set as a trace attribute. azure-monitor exporter will then translate that value into the operation name that is used by App Insights to organize the traces by.

opentelemetry-instrumentation-django is not setting 'http.route' or 'http.url' as a span attribute, resulting in the route not being available to be organize by in AppInsights by path.

@stschenk stschenk added the bug Something isn't working label Oct 7, 2020
@lzchen
Copy link
Contributor

lzchen commented Oct 7, 2020

@stschenk
Thanks for the find.

Seems like django instrumentation isn't fully following http semantic conventions listed here. I believe falcon and fastapi have the same problem.

@stschenk stschenk changed the title DjangoInstrumentor does not provide 'http.route' or 'http.path', azure-monitor exporter does not export request path DjangoInstrumentor does not provide 'http.route', azure-monitor exporter does not export request path Oct 8, 2020
srikanthccv pushed a commit to srikanthccv/opentelemetry-python that referenced this issue Nov 1, 2020
@lzchen lzchen closed this as completed Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants