-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds HttpAdapter.methodFromResponse for route-based span names
Span names like "/users/:userId" now include the method like "delete /users/:userId" This changes the route-based naming convention to include the http method and fixes some glitches not detected before. To support this, we need to make the http method visible in response parsing phase. See openzipkin/zipkin#1874 (comment)
- Loading branch information
Adrian Cole
committed
Feb 23, 2018
1 parent
8ee31a0
commit 4c72334
Showing
14 changed files
with
235 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...spring-webmvc/src/test/java/brave/spring/webmvc/TracingHandlerInterceptorAdapterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package brave.spring.webmvc; | ||
|
||
import brave.spring.webmvc.TracingHandlerInterceptor.Adapter; | ||
import brave.spring.webmvc.TracingHandlerInterceptor.DecoratedHttpServletResponse; | ||
import javax.servlet.http.HttpServletResponse; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.mockito.Mock; | ||
import org.mockito.runners.MockitoJUnitRunner; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@RunWith(MockitoJUnitRunner.class) | ||
public class TracingHandlerInterceptorAdapterTest { | ||
Adapter adapter = new Adapter(); | ||
@Mock HttpServletResponse response; | ||
|
||
@Test public void methodFromResponse() { | ||
assertThat(adapter.methodFromResponse( | ||
new DecoratedHttpServletResponse(response, "GET", null))) | ||
.isEqualTo("GET"); | ||
} | ||
|
||
@Test public void route_emptyByDefault() { | ||
assertThat(adapter.route(new DecoratedHttpServletResponse(response, "GET", null))) | ||
.isEmpty(); | ||
} | ||
|
||
@Test public void route() { | ||
assertThat(adapter.route(new DecoratedHttpServletResponse(response, "GET", "/users/:userID"))) | ||
.isEqualTo("/users/:userID"); | ||
} | ||
} |
Oops, something went wrong.