File tree Expand file tree Collapse file tree 3 files changed +6
-11
lines changed
javaagent-tooling/src/main/java/io/opentelemetry Expand file tree Collapse file tree 3 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ private static void installBytebuddyAgent(
172172
173173 setBootstrapPackages (sdkConfig , extensionClassLoader );
174174 ConfiguredResourceAttributesHolder .initialize (
175- SdkAutoconfigureAccess .getResourceAttributes (autoConfiguredSdk ));
175+ SdkAutoconfigureAccess .getResource (autoConfiguredSdk ). getAttributes ( ));
176176
177177 for (BeforeAgentListener agentListener :
178178 loadOrdered (BeforeAgentListener .class , extensionClassLoader )) {
Original file line number Diff line number Diff line change 1414import io .opentelemetry .sdk .autoconfigure .SdkAutoconfigureAccess ;
1515import io .opentelemetry .sdk .autoconfigure .internal .AutoConfigureUtil ;
1616import io .opentelemetry .sdk .common .CompletableResultCode ;
17- import io .opentelemetry .sdk .resources .Resource ;
1817import java .util .Arrays ;
1918
2019public final class OpenTelemetryInstaller {
@@ -44,13 +43,10 @@ public static AutoConfiguredOpenTelemetrySdk installOpenTelemetrySdk(
4443 // This allows most instrumentations to be unaware of which configuration style is used.
4544 return SdkAutoconfigureAccess .create (
4645 sdk ,
47- // the Resource from the original instance is also the default Resource,
48- // so this is functionally equivalent
49- Resource .getDefault (),
46+ SdkAutoconfigureAccess .getResource (autoConfiguredSdk ),
5047 new DeclarativeConfigPropertiesBridgeBuilder ()
51- .addMapping (
52- "otel.instrumentation.common.default-enabled" , "common.default.enabled" )
53- .addMapping ("otel.javaagent" , "agent" )
48+ .addMapping ("otel.instrumentation.common.default-enabled" , "common.default.enabled" )
49+ .addMapping ("otel.javaagent" , "agent" )
5450 // these properties are used to initialize the SDK before the configuration file
5551 // is loaded for consistency, we pass them to the bridge, so that they can be read
5652 // later with the same value from the {@link DeclarativeConfigPropertiesBridge}
Original file line number Diff line number Diff line change 55
66package io .opentelemetry .sdk .autoconfigure ;
77
8- import io .opentelemetry .api .common .Attributes ;
98import io .opentelemetry .sdk .OpenTelemetrySdk ;
109import io .opentelemetry .sdk .autoconfigure .spi .ConfigProperties ;
1110import io .opentelemetry .sdk .resources .Resource ;
1211
1312public final class SdkAutoconfigureAccess {
1413 private SdkAutoconfigureAccess () {}
1514
16- public static Attributes getResourceAttributes (AutoConfiguredOpenTelemetrySdk sdk ) {
17- return sdk .getResource (). getAttributes () ;
15+ public static Resource getResource (AutoConfiguredOpenTelemetrySdk sdk ) {
16+ return sdk .getResource ();
1817 }
1918
2019 public static AutoConfiguredOpenTelemetrySdk create (
You can’t perform that action at this time.
0 commit comments