Pattern matching

Excluding certain endpoint transactions from your observability data can be a valuable strategy for optimizing performance, reducing noise, and focusing on the most critical aspects of your system.

You can define a exclusion pattern using a regular expression (Regex). Regular expressions are extensively used for matching, searching, and manipulating text based on certain patterns. You can use Regex to filter and analyze data. In the context of endpoints, you can exclude transactions that are not required for you to analyze certain data.

Regex would be processed as a java.util.regex.Pattern with full match. For more information on defining Pattern Strings, refer Java Pattern API Documentation.

Following are some examples to understand Regex values.

Example 1

API: /api/v1/products/123

Regex:

\/api\/(v\d+)\/([\w-]+)\/(\d+)

Regex Explanation:

\/api\/: Matches the literal /api/.

(v\d+): Captures the version, like v1.

v\d+: Matches v followed by one or more digits.

\/([\w-]+): Captures the resource name, like products.

[\w-]+: Matches one or more word characters or hyphens.

\/(\d+): Captures the resource ID, like 123.

\d+: Matches one or more digits.

Example 2

API: /orders/567/items?type=digital&limit=10

Regex:

\/orders\/(\d+)\/([\w-]+)\?([\w=&]+)

Regex Explanation:

\/orders\/: Matches the literal /orders/.

(\d+): Captures the order ID, like 567.

\d+: Matches one or more digits.

\/([\w-]+): Captures the resource name, like items.

[\w-]+: Matches one or more word characters or hyphens.

\?([\w=&]+): Captures the query string, like type=digital&limit=10.

\?: Matches the literal question mark.

([\w=&]+): Captures one or more word characters, equal signs (=), or ampersands (&).