io.opentracing.contrib:opentracing-web-servlet-filter-parent

Support for integrating OpenTracing in Web Servlet projects

License

License

GroupId

GroupId

io.opentracing.contrib
ArtifactId

ArtifactId

opentracing-web-servlet-filter-parent
Last Version

Last Version

0.4.1
Release Date

Release Date

Type

Type

pom
Description

Description

io.opentracing.contrib:opentracing-web-servlet-filter-parent
Support for integrating OpenTracing in Web Servlet projects
Project URL

Project URL

http://github.com/opentracing-contrib/java-web-servlet-filter
Source Code Management

Source Code Management

https://github.com/opentracing-contrib/java-web-servlet-filter

Download opentracing-web-servlet-filter-parent

How to add to project

<!-- https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-web-servlet-filter-parent/ -->
<dependency>
    <groupId>io.opentracing.contrib</groupId>
    <artifactId>opentracing-web-servlet-filter-parent</artifactId>
    <version>0.4.1</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-web-servlet-filter-parent/
implementation 'io.opentracing.contrib:opentracing-web-servlet-filter-parent:0.4.1'
// https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-web-servlet-filter-parent/
implementation ("io.opentracing.contrib:opentracing-web-servlet-filter-parent:0.4.1")
'io.opentracing.contrib:opentracing-web-servlet-filter-parent:pom:0.4.1'
<dependency org="io.opentracing.contrib" name="opentracing-web-servlet-filter-parent" rev="0.4.1">
  <artifact name="opentracing-web-servlet-filter-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='io.opentracing.contrib', module='opentracing-web-servlet-filter-parent', version='0.4.1')
)
libraryDependencies += "io.opentracing.contrib" % "opentracing-web-servlet-filter-parent" % "0.4.1"
[io.opentracing.contrib/opentracing-web-servlet-filter-parent "0.4.1"]

Dependencies

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.mockito : mockito-all jar 1.10.19

Project Modules

  • opentracing-web-servlet-filter

Build Status Released Version

OpenTracing Java Web Servlet Filter Instrumentation

This library provides instrumentation for Java Web Servlet applications.

Initialization

Tracing filter can be programmatically initialized:

   TracingFilter filter = new TracingFilter(tracer);
   servletContext.addFilter("tracingFilter", filter);

or added to web.xml, however it requires to register a tracer instance: GlobalTracer.register(tracer).

Tracer override

If a tracer has been associated with the ServletContext as an attribute with key io.opentracing.Tracer, then it will override any tracer explicitly passed to the filter or registered with the GlobalTracer.

This approach can be used where OpenTracing and Tracer implementation specific dependencies are configured within a servlet container (rather than bundled with the webapp), and we don't wish to share a single GlobalTracer instance across all webapps (e.g. as this may mean all webapps report their spans associated with the same service name).

In these situations, using a ServletContextListener to create a Tracer will enable it to be specific to the webapp and managed with its lifecycle.

Accessing Server Span

Current server span context is accessible in HttpServletRequest attributes.

   SpanContext spanContext = (SpanContext)httpservletRequest.getAttribute(TracingFilter.SERVER_SPAN_CONTEXT);
   

Development

./mvnw clean install

Release

Follow instructions in RELEASE

io.opentracing.contrib

3rd-Party OpenTracing API Contributions

3rd-party contributions that use OpenTracing. **The repositories in this org are *not* affiliated with the CNCF.**

Versions

Version
0.4.1
0.4.0
0.3.0
0.2.3
0.2.2
0.2.1
0.2.0
0.1.1
0.1.0
0.1.0-RC1
0.0.9
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2