Skip to content

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

@stschenk

Description

@stschenk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions