Skip to content

Latest commit

 

History

History

opentracing-spring-web-extension

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

OpenTracing: Spring Web Extension

Stability: Active Build Status Coverage Status Code Quality Javadoc Release Maven Central OpenTracing License

  • Technology stack: Java 8+, OpenTracing, Spring
  • Status: Under development and used in production

Example

registry.addInterceptor(new TracingHandlerInterceptor(
        tracer, singletonList(new StandardSpanDecorator())));

Features

  • applies Zalando's standard tags/logs to each request
  • builds on top of an existing instrumentation (see dependencies)

Dependencies

Installation

Add the following dependency to your project:

<dependency>
    <groupId>org.zalando</groupId>
    <artifactId>opentracing-spring-web-extension</artifactId>
    <version>${opentracing-spring-web-extension.version}</version>
</dependency>

A new span will be started for each request/response.

The following tags/logs are supported out of the box:

Tag/Log Field Decorator Example
http.path HttpPathSpanDecorator /users
error ErrorSpanDecorator true
error.kind (log) ErrorSpanDecorator SocketTimeoutException
error.object (log) ErrorSpanDecorator (exception instance)
message (log) ErrorMessageSpanDecorator Connection timed out
stack (log) ErrorStackSpanDecorator SocketTimeoutException at [...]

Custom SpanDecorator implementations that are registered using Java's Service Provider Interface mechanism will be picked up automatically by default.

Getting Help

If you have questions, concerns, bug reports, etc., please file an issue in this repository's Issue Tracker.

Getting Involved/Contributing

To contribute, simply make a pull request and add a brief description (1-2 sentences) of your addition or change. For more details, check the contribution guidelines.