Integration with Spring Sleuth #257

meong1234 opened this Issue Jan 25, 2017 · 2 comments


None yet

3 participants


it nice if axon provide integration with distrubuted tracing use spring sleuth


public class TraceEventHandler {

private static final String EVENT_HANDLER_COMPONENT = "eventhandler";

private final Tracer tracer;
private final TraceKeys traceKeys;
private final Pattern skipPattern;

public TraceEventHandler(Tracer tracer, TraceKeys traceKeys, Pattern skipPattern) {
    this.tracer = tracer;
    this.traceKeys = traceKeys;
    this.skipPattern = skipPattern;

@Around("execution (@org.axonframework.eventhandling.annotation.EventHandler  * *.*(..))")
public Object traceBackgroundThread(final ProceedingJoinPoint pjp) throws Throwable {
    if (this.skipPattern.matcher(pjp.getTarget().getClass().getName()).matches()) {
        return pjp.proceed();
    String spanName = SpanNameUtil.toLowerHyphen(pjp.getSignature().getName());
    Span span = this.tracer.createSpan(spanName);
    this.tracer.addTag(this.traceKeys.getAsync().getPrefix() +
        this.traceKeys.getAsync().getClassNameKey(), pjp.getTarget().getClass().getSimpleName());
    this.tracer.addTag(this.traceKeys.getAsync().getPrefix() +
        this.traceKeys.getAsync().getMethodNameKey(), pjp.getSignature().getName());
    try {
        return pjp.proceed();
    finally {


example by use anotation @EventHandler

@abuijze abuijze added the Feature label Jan 25, 2017

just a thought, IIRC axon3 supports dropwizard, so you might be able to get something working combining , and the zipkin connector of spring cloud sleuth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment