Previously the SDK did not log the application version in the OTel standard service.version attribute, so I added the following line to my app:
try embrace.metadata.addResource(key: ResourceAttributes.serviceVersion.rawValue, value: "1.0.0");
SDK from version 6.12 added automatic logging of this OTel property in #254, so I removed the line from the app code. Now I'm getting OTel traces on my OTel collector where emb.app.version and emb.app.bundle_version are up to date, but service.version contains an earlier version: the last version of the app which still had the above line. Even if I add this line
try embrace.metadata.removeResource(key: ResourceAttributes.serviceVersion.rawValue);
the field is still included in the attributes logged to OTel.
I can see that the resource API is deprecated, but I would still like a way to clear this wrongly persisted value so that the logic in
|
if attributes[SemanticConventions.Service.version.rawValue] == nil, let appVersion = EMBDevice.appVersion { |
can kick in and provide the correct value.
Please note that this bug is not specific to service.version: any session scoped resource attribute added, even in an earlier version of the SDK, has persisted in the database and pollutes the attributes logged to OTel.
Previously the SDK did not log the application version in the OTel standard
service.versionattribute, so I added the following line to my app:try embrace.metadata.addResource(key: ResourceAttributes.serviceVersion.rawValue, value: "1.0.0");SDK from version 6.12 added automatic logging of this OTel property in #254, so I removed the line from the app code. Now I'm getting OTel traces on my OTel collector where
emb.app.versionandemb.app.bundle_versionare up to date, butservice.versioncontains an earlier version: the last version of the app which still had the above line. Even if I add this linetry embrace.metadata.removeResource(key: ResourceAttributes.serviceVersion.rawValue);the field is still included in the attributes logged to OTel.
I can see that the resource API is deprecated, but I would still like a way to clear this wrongly persisted value so that the logic in
embrace-apple-sdk/Sources/EmbraceCore/Internal/ResourceStorageExporter/ResourceStorageExporter.swift
Line 51 in 955d252
can kick in and provide the correct value.
Please note that this bug is not specific to
service.version: any session scoped resource attribute added, even in an earlier version of the SDK, has persisted in the database and pollutes the attributes logged to OTel.