-
Notifications
You must be signed in to change notification settings - Fork 66
Implement app.installation.id
resource attribute
#922
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
Comments
For now, I think generating one and using it will be sufficient. If there's a need to override, we can take that in a separate PR? |
Sure, sounds good to me. |
I started looking into implementing these and I think it's considerably trickier than we think, primarily due to the fact that this is a resource attribute, and resources are immutable and created in the hot path at app start.
The docs around |
@breedx-splk that's a really tricky one. The approach, which I'd consider the most optimal from the SDK user's point of view is to defer the creation of the That said, I don't see any straight-forward way to achieve this, as the All the alternatives I can think of for delaying the registration of the Resource object are more intrusive or require huge refactors to the Java SDK. So going forward I see these possible approaches:
At work I've implemented the 2nd alternative built on top of the Java SDK. It was easy for us, because we are only using logging, and our Logback OpenTelemetryAppender buffers log records in memory until the OpenTelemetry object is This is where I currently am in this thought process, and I still haven't made up my mind, which of these alternatives to recommend. I was optimistic for the first one, but my simplest approach didn't work sadly. Which of these alternatives do you find the most optimal? Can you think of other alternative solutions? |
For For anything that is tied to the built APK, we can generate a file at build time and load that in via the classloader. That has worked really well for us |
Per our discussion at the SIG today, I think we should just store it in shared preferences and read it, and make a note in the docs saying that while this can cause a strict mode violation, it's the lesser of all evils and the practice impact of the implementation should be minimal (and lets make sure it is :-)) |
Uh oh!
There was an error while loading. Please reload this page.
The experimental semconv
app.installation.id
got accepted recently (open-telemetry/semantic-conventions#1897), I think it would be a useful addition to the existing attributes provided by the SDK.What makes its implementation a bit tricky, is that there are multiple ways you can implement this resource attribute on Android. In the specs we have listed these four options:
As @bidetofevil pointed out the most practical choice for this SDK is probably number two (UUID), however, I could imaging exposing a setter for each of the options, as they all have pros and cons.
The text was updated successfully, but these errors were encountered: