embrace-android-sdk icon indicating copy to clipboard operation
embrace-android-sdk copied to clipboard

OTel service version field should contain the version of the client app

Open mmarczell-graphisoft opened this issue 6 months ago • 4 comments

When exporting to OTel, every telemetry item contains a field called telemetry.distro.version and one called service.version. Currently both are set to the version of the OpenTelemetry SDK. If I understand correctly, service.version was intended to contain the version of the "service" (= web server application) that the telemetry describes. Therefore the Embrace SDK should set this field to the version of the mobile app.

See https://github.com/embrace-io/embrace-android-sdk/blob/d2581cf323fdad3e11f380db8c02c757b7455d5f/embrace-android-otel/src/main/kotlin/io/embrace/android/embracesdk/internal/otel/config/OtelSdkConfig.kt#L32-L34

I would send a PR but I need some guidance regarding where to obtain the application version, because it seems OtelSdkConfig is initialized before CoreModule.

mmarczell-graphisoft avatar Jun 02 '25 15:06 mmarczell-graphisoft

Hi there - this isn't done right now because it would require doing a disk read before starting the SDK, which would hamper performance. We have a task to automatically populate this in a performant way without doing a disk read before we start the SDK, but we haven't done it yet.

In the meantime, you can override what is set by re-setting this before you start the SDK by calling Embrace.setResourceAttribute()?

bidetofevil avatar Jun 03 '25 14:06 bidetofevil

hi @mmarczell-graphisoft - i just wanted to follow up and see if that worked for you?

eliabsisay avatar Jul 08 '25 16:07 eliabsisay

Hi @eliabsisay, yes the recommended workaround worked.

mmarczell-graphisoft avatar Jul 09 '25 08:07 mmarczell-graphisoft

@bidetofevil can you provide some context on why this ended up "not planned"? I can see there was a PR resolving this in the way you mentioned (no disk reads) and it was closed without being merged.

mmarczell-graphisoft avatar Sep 15 '25 08:09 mmarczell-graphisoft

I don't think this was supposed to be closed

mmarczell-graphisoft avatar Nov 24 '25 09:11 mmarczell-graphisoft

Sorry - GitHub Actions auto closed this.

Yes, we're going to get to this soon. We are looking to release 8.0 soon, and we'll get to this right after, so likely looking at a late December time frame?

Which PR are you referencing? If it's done and tested we might even be able to get it in sooner (no promises 😅 )

bidetofevil avatar Nov 24 '25 17:11 bidetofevil

#2484 was an AI-authored PR but @fractalwrench was not satisfied so it wasn't merged.

mmarczell-graphisoft avatar Nov 25 '25 10:11 mmarczell-graphisoft