Skip to content

Commit ffd154d

Browse files
JACQUES FrancoisJACQUES Francois
authored andcommitted
Fixes opentracing-contrib#135 : add ContainerRequestContext to decorateResponse arguments.
1 parent 32ca3b8 commit ffd154d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

opentracing-jaxrs2/src/main/java/io/opentracing/contrib/jaxrs2/server/ServerSpanDecorator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ public interface ServerSpanDecorator {
2222
/**
2323
* Decorate spans by outgoing object.
2424
*
25+
* @param requestContext
2526
* @param responseContext
2627
* @param span
2728
*/
28-
void decorateResponse(ContainerResponseContext responseContext, Span span);
29+
void decorateResponse(ContainerRequestContext requestContext, ContainerResponseContext responseContext, Span span);
2930

3031
/**
3132
* Adds standard tags: {@link io.opentracing.tag.Tags#SPAN_KIND},
@@ -45,7 +46,7 @@ public void decorateRequest(ContainerRequestContext requestContext, Span span) {
4546
}
4647

4748
@Override
48-
public void decorateResponse(ContainerResponseContext responseContext, Span span) {
49+
public void decorateResponse(ContainerRequestContext requestContext, ContainerResponseContext responseContext, Span span) {
4950
Tags.HTTP_STATUS.set(span, responseContext.getStatus());
5051
}
5152
};

opentracing-jaxrs2/src/main/java/io/opentracing/contrib/jaxrs2/server/ServerTracingFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public void filter(ContainerRequestContext requestContext,
121121

122122
if (spanDecorators != null) {
123123
for (ServerSpanDecorator decorator: spanDecorators) {
124-
decorator.decorateResponse(responseContext, spanWrapper.get());
124+
decorator.decorateResponse(requestContext, responseContext, spanWrapper.get());
125125
}
126126
}
127127
}

0 commit comments

Comments
 (0)