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(
172
172
173
173
setBootstrapPackages (sdkConfig , extensionClassLoader );
174
174
ConfiguredResourceAttributesHolder .initialize (
175
- SdkAutoconfigureAccess .getResourceAttributes (autoConfiguredSdk ));
175
+ SdkAutoconfigureAccess .getResource (autoConfiguredSdk ). getAttributes ( ));
176
176
177
177
for (BeforeAgentListener agentListener :
178
178
loadOrdered (BeforeAgentListener .class , extensionClassLoader )) {
Original file line number Diff line number Diff line change 14
14
import io .opentelemetry .sdk .autoconfigure .SdkAutoconfigureAccess ;
15
15
import io .opentelemetry .sdk .autoconfigure .internal .AutoConfigureUtil ;
16
16
import io .opentelemetry .sdk .common .CompletableResultCode ;
17
- import io .opentelemetry .sdk .resources .Resource ;
18
17
import java .util .Arrays ;
19
18
20
19
public final class OpenTelemetryInstaller {
@@ -44,13 +43,10 @@ public static AutoConfiguredOpenTelemetrySdk installOpenTelemetrySdk(
44
43
// This allows most instrumentations to be unaware of which configuration style is used.
45
44
return SdkAutoconfigureAccess .create (
46
45
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 ),
50
47
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" )
54
50
// these properties are used to initialize the SDK before the configuration file
55
51
// is loaded for consistency, we pass them to the bridge, so that they can be read
56
52
// later with the same value from the {@link DeclarativeConfigPropertiesBridge}
Original file line number Diff line number Diff line change 5
5
6
6
package io .opentelemetry .sdk .autoconfigure ;
7
7
8
- import io .opentelemetry .api .common .Attributes ;
9
8
import io .opentelemetry .sdk .OpenTelemetrySdk ;
10
9
import io .opentelemetry .sdk .autoconfigure .spi .ConfigProperties ;
11
10
import io .opentelemetry .sdk .resources .Resource ;
12
11
13
12
public final class SdkAutoconfigureAccess {
14
13
private SdkAutoconfigureAccess () {}
15
14
16
- public static Attributes getResourceAttributes (AutoConfiguredOpenTelemetrySdk sdk ) {
17
- return sdk .getResource (). getAttributes () ;
15
+ public static Resource getResource (AutoConfiguredOpenTelemetrySdk sdk ) {
16
+ return sdk .getResource ();
18
17
}
19
18
20
19
public static AutoConfiguredOpenTelemetrySdk create (
You can’t perform that action at this time.
0 commit comments