File tree Expand file tree Collapse file tree 4 files changed +14
-9
lines changed
main/java/org/zalando/riptide/opentelemetry/span
test/java/org/zalando/riptide/opentelemetry Expand file tree Collapse file tree 4 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 1818
1919 <properties >
2020 <opentelemetry .version>1.39.0</opentelemetry .version>
21- <opentelemetry-semconv .version>1.25 .0-alpha </opentelemetry-semconv .version>
21+ <opentelemetry-semconv .version>1.30 .0-rc.1 </opentelemetry-semconv .version>
2222 </properties >
2323
2424 <dependencyManagement >
4848 <artifactId >opentelemetry-semconv</artifactId >
4949 <version >${opentelemetry-semconv.version} </version >
5050 </dependency >
51+ <dependency >
52+ <groupId >io.opentelemetry.semconv</groupId >
53+ <artifactId >opentelemetry-semconv-incubating</artifactId >
54+ <version >1.30.0-alpha-rc.1</version >
55+ </dependency >
5156 <dependency >
5257 <groupId >io.opentelemetry</groupId >
5358 <artifactId >opentelemetry-sdk-testing</artifactId >
Original file line number Diff line number Diff line change 11package org .zalando .riptide .opentelemetry .span ;
22
33import io .opentelemetry .api .trace .Span ;
4- import io .opentelemetry .semconv .SemanticAttributes ;
4+ import io .opentelemetry .semconv .incubating . HttpIncubatingAttributes ;
55import org .zalando .riptide .RequestArguments ;
66
77public class HttpHostSpanDecorator implements SpanDecorator {
88
99 @ Override
1010 public void onRequest (final Span span , final RequestArguments arguments ) {
11- span .setAttribute (SemanticAttributes .HTTP_HOST , arguments .getRequestUri ().getHost ());
11+ span .setAttribute (HttpIncubatingAttributes .HTTP_HOST , arguments .getRequestUri ().getHost ());
1212 }
1313}
Original file line number Diff line number Diff line change 11package org .zalando .riptide .opentelemetry .span ;
22
33import io .opentelemetry .api .trace .Span ;
4- import io .opentelemetry .semconv .SemanticAttributes ;
4+ import io .opentelemetry .semconv .incubating . HttpIncubatingAttributes ;
55import org .zalando .riptide .RequestArguments ;
66
77public class HttpMethodSpanDecorator implements SpanDecorator {
88
99 @ Override
1010 public void onRequest (final Span span , final RequestArguments arguments ) {
11- span .setAttribute (SemanticAttributes .HTTP_METHOD , arguments .getMethod ().name ());
11+ span .setAttribute (HttpIncubatingAttributes .HTTP_METHOD , arguments .getMethod ().name ());
1212 }
1313}
Original file line number Diff line number Diff line change 1010import io .opentelemetry .sdk .trace .data .EventData ;
1111import io .opentelemetry .sdk .trace .data .SpanData ;
1212import io .opentelemetry .sdk .trace .data .StatusData ;
13- import io .opentelemetry .semconv .SemanticAttributes ;
13+ import io .opentelemetry .semconv .ExceptionAttributes ;
1414import lombok .SneakyThrows ;
1515import okhttp3 .mockwebserver .MockResponse ;
1616import okhttp3 .mockwebserver .MockWebServer ;
@@ -204,9 +204,9 @@ void shouldTraceRequestAndNetworkError() {
204204 assertThat (events .size (), is (1 ));
205205
206206 final Attributes eventAttributes = child .getEvents ().get (0 ).getAttributes ();
207- assertThat (eventAttributes .get (SemanticAttributes .EXCEPTION_TYPE ), containsString ("SocketTimeoutException" ));
208- assertThat (eventAttributes .get (SemanticAttributes .EXCEPTION_MESSAGE ), containsString ("Read timed out" ));
209- assertThat (eventAttributes .get (SemanticAttributes .EXCEPTION_STACKTRACE ), is (notNullValue ()));
207+ assertThat (eventAttributes .get (ExceptionAttributes .EXCEPTION_TYPE ), containsString ("SocketTimeoutException" ));
208+ assertThat (eventAttributes .get (ExceptionAttributes .EXCEPTION_MESSAGE ), containsString ("Read timed out" ));
209+ assertThat (eventAttributes .get (ExceptionAttributes .EXCEPTION_STACKTRACE ), is (notNullValue ()));
210210
211211 verify (server , 1 , "/" );
212212 }
You can’t perform that action at this time.
0 commit comments