Skip to content

Commit

Permalink
Merge pull request #38 from zalando/feature/auto-configuration-interc…
Browse files Browse the repository at this point in the history
…eptor

Added interceptors to AutoConfiguration
  • Loading branch information
whiskeysierra committed May 27, 2016
2 parents 2e28a5a + dace413 commit c870719
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tracer-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
<groupId>org.zalando</groupId>
<artifactId>tracer-aspectj</artifactId>
</dependency>
<dependency>
<groupId>org.zalando</groupId>
<artifactId>tracer-httpclient</artifactId>
</dependency>
<dependency>
<groupId>org.zalando</groupId>
<artifactId>tracer-servlet</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.zalando.tracer.TraceListener;
import org.zalando.tracer.Tracer;
import org.zalando.tracer.aspectj.TracedAspect;
import org.zalando.tracer.httpclient.TracerHttpRequestInterceptor;
import org.zalando.tracer.servlet.TracerFilter;

import javax.servlet.Filter;
Expand Down Expand Up @@ -84,6 +85,12 @@ public FilterRegistrationBean tracerFilter(final Tracer tracer) {
return registration;
}

@Bean
@ConditionalOnMissingBean(TracerHttpRequestInterceptor.class)
public TracerHttpRequestInterceptor tracerHttpRequestInterceptor(final Tracer tracer) {
return new TracerHttpRequestInterceptor(tracer);
}

@ConditionalOnClass(Aspect.class)
@ConditionalOnProperty(name = "tracer.aspect.enabled", havingValue = "true", matchIfMissing = true)
@EnableAspectJAutoProxy
Expand Down

0 comments on commit c870719

Please sign in to comment.