Skip to content

Commit

Permalink
PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitlinger committed Mar 14, 2024
1 parent 86d0bd2 commit 35bcc88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public Resource createResource(ConfigProperties config) {
public int order() {
// Environment resource takes precedent over all other ResourceProviders except
// ServiceInstanceIdResourceProvider.
return Integer.MAX_VALUE - 1;
return ServiceInstanceIdResourceProvider.ORDER - 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ public final class ServiceInstanceIdResourceProvider implements ConditionalResou
AttributeKey.stringKey("service.instance.id");

// multiple calls to this resource provider should return the same value
public static final Resource RANDOM =
private static final Resource RANDOM =
Resource.create(Attributes.of(SERVICE_INSTANCE_ID, UUID.randomUUID().toString()));

static final int ORDER = Integer.MAX_VALUE;

@Override
public Resource createResource(ConfigProperties config) {
return RANDOM;
Expand All @@ -40,6 +42,6 @@ public boolean shouldApply(ConfigProperties config, Resource existing) {
public int order() {
// Run after environment resource provider - only set the service instance ID if it
// hasn't been set by any other provider.
return Integer.MAX_VALUE;
return ORDER;
}
}

0 comments on commit 35bcc88

Please sign in to comment.