camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Koscejev (JIRA)" <>
Subject [jira] [Commented] (CAMEL-11646) Upgrade brave to allow simple MDC logging
Date Tue, 08 Aug 2017 15:42:00 GMT


Anton Koscejev commented on CAMEL-11646:

According to the [OpenTracing API documentation|]
it seems that the spans should be activated and deactivated. 

E.g., a span can be created via {{Tracer.SpanBuilder.startActive()}} or it can be created
via  {{Tracer.SpanBuilder.startManual()}}
(which is done right now, except using the deprecated {{start()}} method) and later activated
via {{ActiveSpanSource.makeActive()}}. 
Consequently, an ActiveSpan should be deactivated via {{ActiveSpan.deactivate()}}.
The activation/deactivation is currently not done - this is probably a bug/oversight. This
results in any CurrentTraceContext not working correctly, which is why MDCCurrentTraceContext
cannot be applied.

A workaround that seems to work, but is probably not performing (de)activation at the correct
InterceptStrategy activateSpanInterceptStrategy(Tracer tracer) {
  // CAMEL-11646 spans are not activated currently
  return (context, definition, target, nextTarget) -> exchange -> {
    Optional<ActiveSpan> activeSpan = Optional.ofNullable(ActiveSpanManager.getSpan(exchange))
    try {
    } finally {
Perhaps this logic can just be built into ActiveSpanManager, so it "holds" an ActiveSpan instance,
not Span?

> Upgrade brave to allow simple MDC logging
> -----------------------------------------
>                 Key: CAMEL-11646
>                 URL:
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-opentracing
>    Affects Versions: 2.19.1
>            Reporter: Radek Mensik
> It would be nice if spans are logged as we know it from spring-sleuth. Simplest could
be usage of brave-context-slf4j
> Unfortunately this requires higher version of brave. I tried to make it work with 2.20.0-SNAPSHOT
but no luck..

This message was sent by Atlassian JIRA

View raw message