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

[@azure/monitor-opentelemetry-exporter] Problem with SEMATTRS_ENDUSER_ID on backend, it didnt show in Application Insights as User Id properly. #29182

Closed
1 task
CrazyBaran opened this issue Apr 5, 2024 · 8 comments
Assignees
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 - Exporter Monitor OpenTelemetry Exporter 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

Comments

@CrazyBaran
Copy link

CrazyBaran commented Apr 5, 2024

  • Package Name: @azure/monitor-opentelemetry-exporter
  • Package Version: 1.0.0-beta.21
  • Operating system: Windows
  • nodejs
    • version:

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:

const endUserId = span.attributes[SEMATTRS_ENDUSER_ID];

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 as enduser.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:
image
As is from OpenTelemetry from nodejs backend:
image
As is from Angular SPA from browser with use of ApplicationInsights JS SDK:
image

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

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 5, 2024
@CrazyBaran CrazyBaran changed the title Problem with SEMATTRS_ENDUSER_ID on backend, it didnt show in Application Insights as User Id properly. [@azure/monitor-opentelemetry-exporter] Problem with SEMATTRS_ENDUSER_ID on backend, it didnt show in Application Insights as User Id properly. Apr 5, 2024
@JacksonWeber
Copy link
Member

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.

@CrazyBaran
Copy link
Author

@JacksonWeber My main problem was that ai.user.id is not showing up in application insights. This inconsistency is some minor issue.

@JacksonWeber
Copy link
Member

@CrazyBaran Ah, I see. Yes, this issue will be resolved by #28965 as it provides support for the User Id property.

@jeremymeng jeremymeng added Client This issue points to a problem in the data-plane of the library. Monitor - Exporter Monitor OpenTelemetry Exporter and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Apr 10, 2024
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Apr 10, 2024
@JacksonWeber JacksonWeber removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Apr 12, 2024
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Apr 12, 2024
@JacksonWeber
Copy link
Member

@CrazyBaran Please let me know if the above PR resolved the issue for you, and let me know if you have any other issues!

@JacksonWeber JacksonWeber added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Jun 6, 2024
Copy link

github-actions bot commented Jun 6, 2024

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.

@github-actions github-actions bot removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Jun 6, 2024
Copy link

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!

@github-actions github-actions bot added the no-recent-activity There has been no recent activity on this issue. label Jun 13, 2024
@CrazyBaran
Copy link
Author

@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.

@github-actions github-actions bot added needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team and removed needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. labels Jun 13, 2024
@JacksonWeber
Copy link
Member

Closing as issue is resolved. Thank you for reporting this!

@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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 - Exporter Monitor OpenTelemetry Exporter 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
Projects
None yet
Development

No branches or pull requests

4 participants