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

Add enduser.anon_id to general attributes #443

Closed
wants to merge 2 commits into from

Conversation

amertak
Copy link

@amertak amertak commented Oct 25, 2023

Changes

Adding enduser.anon_id to handle case of enduser which is not authorized/authenticated but we want a way to track their visits throughout the lifetime

Note: if the PR is touching an area that is not listed in the existing areas, or the area does not have sufficient domain experts coverage, the PR might be tagged as experts needed and move slowly until experts are identified.

Merge requirement checklist

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 25, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@amertak amertak changed the title feat: add enduser.anon_id Add enduser.anon_id to general attributes Oct 25, 2023
@AlexanderWert
Copy link
Member

@amertak Can you explain, please, why would need a new attribute for this instead of just extending the definition/description of enduser.id?

@amertak
Copy link
Author

amertak commented Oct 25, 2023

@AlexanderWert enduser.id and enduser.anon_id are complementary.

For example you want to model user entity, user entity should always have some id that is unique for storage platform of choice and kept indefinitely on the client side in cookie/local storage/etc...

Enduser can be later on identified on the client's platform - can register/login and this id that is provided by owner of the client's platform will be added to the user entity. Given that we have anonymous id available we can now connect all previous user activities/events. Rewriting anonymous id with authorized id would cause us to basically create new user entity and lose that connection.

Hope this makes sense.

@scheler
Copy link
Contributor

scheler commented Oct 30, 2023

@AlexanderWert this is to represent an anonymous user in the client side apps, web and mobile apps, prior to user logging in. In a session when a user logs in, we will stop sending enduser.anon_id and start sending enduser.id. and I think it's not a good idea to use enduser.id for both as it will be confusing. Also, having a separate attribute helps in sending both so we can connect them during the transition, that is, after login.

Please let us know if this explanation is sufficient.


<!-- semconv identity -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `enduser.id` | string | Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. | `username` | Recommended |
| `enduser.anon_id` | string | Randomly generated id of an anonymous user that is persisted throughout the lifetime of the visits. | `V1StGXR8_Z5jdHi6B-myT` | Recommended |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see it called out (a bit more) that this value can be any (attribute) "valid" value such as a GUID.

Here is a description of this field (which we called a different name as part of our planning), which has the same meaning as what you are introducing. here.

Client RUM description: Anonymous user id - will be the same for a given browser session. It will persist across page navigations in the same browser session

Value: String / GUID

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should also clarify that this is different than a session. The user ID will will persist across page navigations like session ID. However, session can expire while the user ID will not. In other words, user ID will be the same across multiple sessions. Am I understanding this correctly?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true, but I think semantic conventions only what the attribute represents and not any other details.


<!-- semconv identity -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `enduser.id` | string | Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. | `username` | Recommended |
| `enduser.anon_id` | string | Randomly generated id of an anonymous user that is persisted throughout the lifetime of the visits. | `V1StGXR8_Z5jdHi6B-myT` | Recommended |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

persisted throughout the lifetime of the visits

If I understood correctly, it'd be an ID that would only persist for as long as the user interacts with the app, if that's the case, wouldn't this use case be already covered by the session.id attr? - The session id might also help with tracking the whole process of before, during, and after the user login happens, since the same session id will get sent even the user logs in, whereas it seems like enduser.anon_id would not be sent after the user has been authenticated?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LikeTheSalad The same browser instance can be used to have multiple sessions at different times but the anonymous user will be the same in all these sessions.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, it's similar to device.id ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it's close to device.id, but not the same. Browsers, including on mobile, in incognito mode will generate a new enduser.anon_id. For mobile apps is there a possibility of ever requiring a different anon_id? If not, then I guess device.id can be used for enduser.anon_id.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mildly 🌶 take but I would say people used to web dev would be understanding that incognito and cross-TLD (considering cookie limitations) would lead to multiple IDs from same "physical" device - even if the attribute would be called device.id

So I'd be fine with just using device.id for this use case with asterisks that "runtime sandboxes" could lead to multiple different ID's for physical device

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@t2t2 I am concerned about the intent of this attribute. The reason to put this under enduser namespace is really to represent an anonymous user, although its value can be device's id whenever it's available. And this attribute goes beyond Client side situations - for anonymous sessions, the backend telemetry too can include the anonymous user id too - the clients will have to pass it via baggage or some such mechanism to the backends. In this context, I also want to note that we cannot use session.id for this purpose since the same anonymous user can have multiple sessions.

I still feel it's good to have this attribute enduser.anon_id to represent anonymous users.

@open-telemetry/specs-semconv-approvers I am curious what your thoughts are on this since this goes beyond Client instrumentation concerns.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@open-telemetry/specs-semconv-approvers can we get some attention on this please? This is an attribute that some of us vendors would like to add to all signals via processors, and so shouldn't be an issue to others. Is there a general guidance on semantic conventions on attributes added by processors, not necessarily by instrumentations? if there is a general agreement from your side on this PR, we can go ahead make the required text changes further. Thank you!

@amertak amertak marked this pull request as ready for review November 7, 2023 08:10
@amertak amertak requested review from a team November 7, 2023 08:10
@amertak amertak force-pushed the patch-1 branch 2 times, most recently from a4a9b66 to 55c411d Compare November 8, 2023 08:40

<!-- semconv identity -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `enduser.anon_id` | string | Randomly generated id of an anonymous user that is persisted throughout the lifetime of the visits. | `V1StGXR8_Z5jdHi6B-myT` | Recommended |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wanted to raise the question of anon_id vs anonymous_id, I'm not sure if we have good (any?) guidance on when to use abbreviations in attribute names

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(btw I opened #602 to seek more comments / guidance on the general question of abbreviations)

Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jan 25, 2024
Copy link

github-actions bot commented Feb 4, 2024

Closed as inactive. Feel free to reopen if this PR is still being worked on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

9 participants