-
Notifications
You must be signed in to change notification settings - Fork 33
Java Servlet
paulcleary edited this page Nov 10, 2015
·
2 revisions
- You are using Java Servlets in your application
- Your application is used by another application that is also instrumented with Money
The Java Servlet module simply provides a Servlet Filter that you can use in any application that uses servlets.
The filter will look for the money trace HTTP Request header, and automatically set the trace context based on the span provided in the trace header. When you start new spans within your application, they will be child spans of the span that comes from the Http Header. This is critical when there are many different systems involved in a single request trace.
Add a dependency as follows for maven:
<dependency>
<groupId>com.comcast.money</groupId>
<artifactId>money-java-servlet_2.10</artifactId>
<version>${money.version}</version>
</dependency>
And here is a dependency for SBT:
libraryDependencies += "com.comcast.money" %% "money-java-servlet" % "${money.version}"
In your web.xml for your project, you can configure the filter so that it captures incoming HTTP requests.
<filter>
<filter-name>moneyFilter</filter-name>
<filter-class>com.comcast.money.java.servlet.TraceFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>moneyFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
- Overview
- Configuration
- Logging Setup
- Performance Considerations
- Java Users Guide
- Scala Users Guide
- Modules
- Contributing