Skip to main content
Version: 2.32.2

Tomcat

Tomcat Filter

Aperture Java SDK servlet package contains Aperture Filter that can be added to the web.xml file to automatically set traffic control points for relevant services:

API Key

You can create an API key for your project in the Aperture Cloud UI. For detailed instructions on locating API Keys, refer to the API Keys section.

    <filter>
<filter-name>ApertureFilter</filter-name>
<filter-class>com.fluxninja.aperture.servlet.javax.ApertureFilter</filter-class>
<init-param>
<param-name>agent_address</param-name>
<param-value>O</param-value>
</init-param>
<init-param>
<param-name>api_key</param-name>
<param-value>API_KEY</param-value>
</init-param>
</filter>

You can instruct the filter to exclude specific paths from being monitored by the Aperture SDK. For example, you might want to exclude endpoints used for health checks. To achieve this, you can add the path(s) you want to ignore to the filter configuration, as shown in the following code:

<init-param>
<param-name>ignored_paths</param-name>
<param-value>/healthz,/metrics</param-value>
</init-param>

The paths should be specified as a comma-separated list. Note that the paths you specify must match exactly. However, you can change this behavior to treat the paths as regular expressions by setting the ignored_paths_match_regex initialization parameter to true, like so:

<init-param>
<param-name>ignored_paths_match_regex</param-name>
<param-value>true</param-value>
</init-param>

For usage, you can view the example app available in the repository.