-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[@azure/monitor-opentelemetry-exporter] Problem with SEMATTRS_ENDUSER_ID on backend, it didnt show in Application Insights as User Id properly. #29182
Comments
Hi @CrazyBaran thank you for filing this issue. We plan to address this inconsistency soon and will link to this issue once the appropriate PR is up. |
@JacksonWeber My main problem was that ai.user.id is not showing up in application insights. This inconsistency is some minor issue. |
@CrazyBaran Ah, I see. Yes, this issue will be resolved by #28965 as it provides support for the User Id property. |
@CrazyBaran Please let me know if the above PR resolved the issue for you, and let me know if you have any other issues! |
Hi @CrazyBaran. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue. |
Hi @CrazyBaran, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you! |
@JacksonWeber Hey, right now it is working like expected. User showing in App Insight. Still in my opinion should be other semantic key (SEMATTRS_ENDUSER_ID), but this is small thing. |
Closing as issue is resolved. Thank you for reporting this! |
Describe the bug
I setup in span atributes:
span.attributes[SEMATTRS_ENDUSER_ID] = 'test';
,but on Application Insights I got
enduser.id
in Custom Properties not in Request Properties as User ID as it is on browser with application insight SDK.In my opinion this code line should do that, but it didnt work:
azure-sdk-for-js/sdk/monitor/monitor-opentelemetry-exporter/src/utils/spanUtils.ts
Line 64 in 8d1d94a
Maybe it is related to #28965 ?
Expected behavior
When using
SEMATTRS_ENDUSER_ID
value should go to Request, Internal, etc properties as User Id, not to Custom Properties asenduser.id
Additionally in my opinion it should show up as Authenticated User Id as description of
SEMATTRS_ENDUSER_ID
say:"Username or client_id extracted from the access token or Authorization header in the inbound request from outside the system."
Screenshots



Code:
As is from OpenTelemetry from nodejs backend:
As is from Angular SPA from browser with use of ApplicationInsights JS SDK:
Additional Context
In docs it is also mention this way. Docs are little outdated as SemanticAttributes are deprecated to consts.
https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-add-modify?tabs=nodejs#set-the-user-id-or-authenticated-user-id
The text was updated successfully, but these errors were encountered: