Skip to content

Commit

Permalink
check for version in existing resource
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitlinger committed Feb 14, 2024
1 parent 002534d commit edf98c9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public Resource createResource(ConfigProperties config) {
@Override
public boolean shouldApply(ConfigProperties config, Resource existing) {
return !config
.getMap("otel.resource.attributes")
.containsKey(ResourceAttributes.SERVICE_VERSION.getKey());
.getMap("otel.resource.attributes")
.containsKey(ResourceAttributes.SERVICE_VERSION.getKey())
&& existing.getAttribute(ResourceAttributes.SERVICE_VERSION) == null;
}
}

0 comments on commit edf98c9

Please sign in to comment.