census-instrumentation / opencensus-python

A stats collection and distributed tracing framework
Apache License 2.0
669 stars 250 forks source link

Django request traces sent to AzureExporter do not specify the user_Id or session_Id #898

Open Bastien-Brd opened 4 years ago

Bastien-Brd commented 4 years ago

Python 3.5.2 Django 2.2.10 opencensus==0.7.7 opencensus-context==0.1.1 opencensus-ext-azure==1.0.2 opencensus-ext-django==0.7.2 opencensus-ext-logging==0.1.0

The traces sent to Azure Monitor by the AzureExporter, collected by the opencensus Django middleware, set the custom properties django.user.id and django.user.name, and these properties are indeed well listed in Azure Monitor for these requests.

However the main request.user_Id and request.session_Id all appear empty in Azure Monitor, and indeed the AzureExporter source code does not seem to assign any of these as far as I can see.

This results in Azure Monitor listing all requests from my django application (with the correct django.user.id custom properties) with no User ID or Session ID, and the Users and Sessions sections of Azure Monitor are empty (or rather list a single user with empty ID and single session with empty ID.

Screenshot 2020-06-03 at 17 29 34
mike-england commented 3 years ago

I'm looking to set the session_Id in azure but haven't been able to get it to work. Has there been any progress on this issue?

lzchen commented 3 years ago

@mike-england There has not been any progress on this issue.