File tree Expand file tree Collapse file tree 5 files changed +22
-15
lines changed
instrumentation/spring/spring-boot-autoconfigure
main/java/io/opentelemetry/instrumentation/spring/autoconfigure
testDeclarativeConfig/resources
smoke-tests-otel-starter/spring-boot-2/src/testDeclarativeConfig
java/io/opentelemetry/spring/smoketest Expand file tree Collapse file tree 5 files changed +22
-15
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,9 @@ dependencies {
6969 library(" org.springframework.boot:spring-boot-starter-data-jdbc:$springBootVersion " )
7070
7171 implementation(" io.opentelemetry:opentelemetry-sdk-extension-autoconfigure" )
72+ implementation(" io.opentelemetry:opentelemetry-sdk-extension-incubator" )
7273 implementation(project(" :sdk-autoconfigure-support" ))
74+ implementation(project(" :declarative-config-bridge" ))
7375 compileOnly(" io.opentelemetry:opentelemetry-extension-trace-propagators" )
7476 compileOnly(" io.opentelemetry.contrib:opentelemetry-aws-xray-propagator" )
7577 compileOnly(" io.opentelemetry:opentelemetry-exporter-logging" )
@@ -187,16 +189,6 @@ testing {
187189 }
188190 }
189191 }
190-
191- val testStableSemconv by registering(JvmTestSuite ::class ) {
192- targets {
193- all {
194- testTask.configure {
195- jvmArgs(" -Dotel.semconv-stability.opt-in=database" )
196- }
197- }
198- }
199- }
200192 }
201193}
202194
Original file line number Diff line number Diff line change 1212import io .opentelemetry .common .ComponentLoader ;
1313import io .opentelemetry .instrumentation .api .incubator .config .internal .InstrumentationConfig ;
1414import io .opentelemetry .instrumentation .api .internal .EmbeddedInstrumentationProperties ;
15- import io .opentelemetry .instrumentation .sdk .DeclarativeConfigPropertiesBridgeBuilder ;
15+ import io .opentelemetry .instrumentation .config . bridge .DeclarativeConfigPropertiesBridgeBuilder ;
1616import io .opentelemetry .instrumentation .spring .autoconfigure .internal .DeclarativeConfigDisabled ;
1717import io .opentelemetry .instrumentation .spring .autoconfigure .internal .DeclarativeConfigEnabled ;
1818import io .opentelemetry .instrumentation .spring .autoconfigure .internal .OtelDisabled ;
@@ -141,7 +141,7 @@ public ConfigProperties otelProperties(
141141 AutoConfiguredOpenTelemetrySdk autoConfiguredOpenTelemetrySdk ) {
142142 return AutoConfigureUtil .getConfig (autoConfiguredOpenTelemetrySdk );
143143 }
144- }
144+ }
145145
146146 @ Configuration
147147 @ Conditional (DeclarativeConfigEnabled .class )
Original file line number Diff line number Diff line change 11otel :
22 # "file_format" serves as opt-in to the new file format
3- file_format : " 0.4 "
3+ file_format : " 1.0-rc.1 "
44
55 # very lightweight test to make sure the declarative config is loaded
66 # the full config is tested in smoke-tests-otel-starter/spring-boot-2/src/testDeclarativeConfig
Original file line number Diff line number Diff line change 77
88import io .opentelemetry .api .trace .SpanKind ;
99import io .opentelemetry .semconv .HttpAttributes ;
10+ import io .opentelemetry .semconv .ServiceAttributes ;
1011import org .junit .jupiter .api .Test ;
1112import org .springframework .beans .factory .annotation .Autowired ;
1213import org .springframework .beans .factory .annotation .Value ;
@@ -42,7 +43,16 @@ void restTemplate() {
4243 testing .waitAndAssertTraces (
4344 traceAssert ->
4445 traceAssert .hasSpansSatisfyingExactly (
45- span -> HttpSpanDataAssert .create (span ).assertClientGetRequest ("/ping" ),
46+ span ->
47+ HttpSpanDataAssert .create (span )
48+ .assertClientGetRequest ("/ping" )
49+ .hasResourceSatisfying (
50+ r ->
51+ r .hasAttribute (
52+ // to make sure the declarative config is picked up
53+ // in application.yaml
54+ ServiceAttributes .SERVICE_NAME ,
55+ "declarative-config-spring-boot-2" )),
4656 span ->
4757 span .hasKind (SpanKind .SERVER ).hasAttribute (HttpAttributes .HTTP_ROUTE , "/ping" ),
4858 AbstractSpringStarterSmokeTest ::withSpanAssert ));
Original file line number Diff line number Diff line change 11otel :
22 # "file_format" serves as opt-in to the new file format
3- file_format : " 0.4"
3+ file_format : " 1.0-rc.1"
4+ resource :
5+ attributes :
6+ - name : service.name
7+ value : declarative-config-spring-boot-2
8+
49 tracer_provider :
510 processors :
611 - simple :
You can’t perform that action at this time.
0 commit comments