[
https://issues.apache.org/jira/browse/CXF-7608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16328099#comment-16328099
]
ASF GitHub Bot commented on CXF-7608:
-------------------------------------
reta commented on issue #367: [CXF-7608] Propagate trace ids as it lets log
correlation to be consiā¦
URL: https://github.com/apache/cxf/pull/367#issuecomment-358162063
@aldex32 absolutely, here is the test case I have in mind:
```
@Test
public void testThatNoSpansAreRecordedWnenNotSampled() {
final Tracing never = Tracing
.newBuilder()
.reporter(new TestSpanReporter())
.sampler(Sampler.NEVER_SAMPLE)
.build();
final Response r = createWebClient("/bookstore/books", new
BraveClientProvider(never)).get();
assertEquals(Status.OK.getStatusCode(), r.getStatus());
assertThat(TestSpanReporter.getAllSpans().size(), equalTo(0));
assertThatTraceHeadersArePresent(r, false);
}
```
If we run it against the current master, it will fail and still record some
spans. However, with your fix the trace / spans are correctly applying the
sampler rules (in this case - never sampler) and nothing is being recorded.
Please let me know if it makes sense to you. Thanks!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> [brave feature] Propagate trace ids as it lets log correlation to be
> consistent even if not sampling
> ----------------------------------------------------------------------------------------------------
>
> Key: CXF-7608
> URL: https://issues.apache.org/jira/browse/CXF-7608
> Project: CXF
> Issue Type: Bug
> Components: Integration
> Reporter: Aldo Sinanaj
> Priority: Major
>
> Currently the trace ids are not propagated and not reflected on log MDC
> metadata when it is not sampled. Seems that in
> {{AbstractBraveProvider.class}} and {{AbstractBraveClientProvider.class}}
> there is a condition which decides whether or not to do the "brave tracing".
> I had a chat with [~adriancole] and he suggested me to fix this condition by
> removing the check on {{span#isNoop}}, since it is not the provider
> responsibility I guess.
> I'm going to do a pull request on github.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)