Add Support for SpanAttributes.SESSION_ID in Python Azure SDK for Application Insights Integration #39433
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
Monitor - Distro
Monitor OpenTelemetry Distro
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Service Attention
Workflow: This issue is responsible by Azure service team.
Is your feature request related to a problem? Please describe.
We want embrace features of Application Insights and of them is the section about users. I struggled with finding info that for
User Id
to be populated correctly I needed to useSpanAttributes.ENDUSER_ID
fromopentelemetry.semconv.trace import SpanAttributes
, because every doc and stackoverflow said "useai.user.id
" for other languages than python (not much about it for python specifically).Turns out that azure sdk is translating things during export, which in this case
where
ContextTagKeys.AI_USER_ID
is actuallyAI_USER_ID = "ai.user.id"
and everything works just great.Now I have issue with
Session Id
.I figure that if there is AI_USER_ID, there must be something similar for session. And there is
AI_SESSION_ID
in Azure SDK andSESSION_ID = session.id
inopentelemetry.semconv._incubating.attributes.session_attributes
, but I couldn't find a way to add analogical codeand adding
get_current_span().set_attribute("ai.session.id", "000001")
does add a filter in transaction search, but everything is added to a single session in the user section of Application Insights.I would love for Python Community to be able to use those features.
Describe the solution you'd like
Options:
SpanAttributes.SESSION_ID
into SDK as opt-in feature.ContextTagKeys.AI_SESSION_ID
on envelope.Describe alternatives you've considered
_span_events_to_envelopes
Additional context
I do get that SESSION_ID is in experimental as of now, but the opt-in should be enough to address that.
The text was updated successfully, but these errors were encountered: