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

User Context and Custom Context #230

Open
rbarbish opened this issue Jul 31, 2024 · 3 comments
Open

User Context and Custom Context #230

rbarbish opened this issue Jul 31, 2024 · 3 comments

Comments

@rbarbish
Copy link

rbarbish commented Jul 31, 2024

We are going to be implementing the Elastic APM Agent into our iOS and Android apps but recently discovered User Context and Custom Context was implemented in Android but not in iOS yet per https://www.elastic.co/guide/en/observability/8.12/data-model-metadata.html

Is this effort actively in development to add this to the iOS Agent? Is there an ETA for the release? And it is correct that there is no way to add custom metadata to iOS traces? I also noticed iOS was missing from the "Labels" section on the link.

Thanks, Ross

@rbarbish rbarbish changed the title When is User Context and Custom Context getting added to iOS agent? User Context and Custom Context Jul 31, 2024
@bryce-b
Copy link
Contributor

bryce-b commented Jul 31, 2024

Hi @rbarbish,
I don't believe these APIs are provided through the Android agent either; maybe you're looking at the Java agent?
The Elastic iOS and Android agent are built on top of OpenTelemetry, which, at this time, doesn't provide a good way to add attributes dynamically to data signals (i.e.: the username which can update throughout app usage). There are currently a number of efforts in OpenTelemetry to solve this problem, and will likely be an API change/addition on the Otel side of things.

@rbarbish
Copy link
Author

rbarbish commented Aug 1, 2024

Thanks @bryce-b for the reply, you're right I mistook the Java agent for the Android agent. Hmm, well the crux of my problem here is that we need to include the user email address (login) or user guid in the metadata of the traces from iOS and Android apps.

I suppose a workaround for this would be to add the "Session ID (guid)" of the Elastic Session (let elasticSessionId = SessionManager.instance.session(false)) to the Intercom User Properties. It looks like this session id does not change between app launches, but would be a decent way if a user submits a support ticket to search for their Elastic traces. Is there any Elastic session id that is unique to a specific launch of the app?

@bryce-b
Copy link
Contributor

bryce-b commented Aug 2, 2024

We decided to have our session identifiers refresh using a timeout rather than an app background, so there's no way to guarantee a session id will be unique to an app launch.
An alternative that may work for you is to record an event when a user logs in or logs out, and that way you'll be able to use that event to find a session ID and link a session to a user.

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

No branches or pull requests

2 participants