Aligned HTTP instrumentation with Brave (#878)

* Aligned HTTP instrumentation with Brave

with this change we remove TraceFilter and make TraceHandlerInterceptor a legacy component. All HTTP instrumentation is done via Brave.

fixes gh-873
This commit is contained in:
Marcin Grzejszczak
2018-03-04 09:53:52 +01:00
committed by GitHub
parent a9779b15d8
commit 347c63ea82
15 changed files with 295 additions and 814 deletions

View File

@@ -44,7 +44,8 @@ import static org.assertj.core.api.BDDAssertions.then;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = { IntegrationSpanCollectorConfig.class, SampleMessagingApplication.class },
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@TestPropertySource(properties = { "sample.zipkin.enabled=true" })
@TestPropertySource(properties = { "sample.zipkin.enabled=true",
"spring.sleuth.http.legacy.enabled=true" })
@DirtiesContext
public class MessagingApplicationTests extends AbstractIntegrationTest {
@@ -76,7 +77,7 @@ public class MessagingApplicationTests extends AbstractIntegrationTest {
long spanId = new Random().nextLong();
await().atMost(15, SECONDS).untilAsserted(() ->
httpMessageWithTraceIdInHeadersIsSuccessfullySent(sampleAppUrl + "/", traceId, spanId).run()
httpMessageWithTraceIdInHeadersIsSuccessfullySent(sampleAppUrl + "/", traceId, spanId).run()
);
await().atMost(15, SECONDS).untilAsserted(() -> {
@@ -140,7 +141,7 @@ public class MessagingApplicationTests extends AbstractIntegrationTest {
private Optional<Span> findLastHttpSpansParent() {
return this.integrationTestSpanCollector.hashedSpans.stream()
.filter(span -> "get".equals(span.name()) && span.kind() != null).findFirst();
.filter(span -> "http:/".equals(span.name()) && span.kind() != null).findFirst();
}
private Optional<Span> findSpanWithKind(Span.Kind kind) {