URL-based sampling

OneAgent version 1.281+

To modify a specific trace contribution to the environment trace volume, you can customize the capturing frequency of specific URLs to your needs.

Wildcard ** use for URL-based sampling

  1. Go to Settings > Server-side service monitoring > URL-based sampling.
  2. Select Add URL.
  3. Create your new rule.
    1. Modify OneAgent capturing frequency as needed.

      • To increase or reduce the frequency of trace capture for a URL once the peak trace volume is exceeded, set Importance of a specific URL to a different scaling factor.
      • To never capture traces for a URL, regardless of the available trace volume, turn on Ignore URLs with specific path and/or query parameters.
    2. Type the URL path or specify query parameters.

      Use wildcards (**) for URLs with similar segment paths, such as URLs of the same domain.

      For example, in /api/product/**/detail, all values between slashes are ignored; the path applies to both /api/product/1/detail and /api/product/2/detail.

      To specify query parameters, go to Query parameters and select Add item.

      1. Type a query parameter name.
      2. Type the query parameter value or turn on Query parameter value is undefined.
    3. optional To apply the scaling factor to one or more HTTP methods, turn off Any HTTP method and select the HTTP method(s) to target.

  4. Select Save changes.

Process and process group override

To override URL-based sampling environment settings for a specific process group or process

  • On the process group level, select More () > Process group settings and select URL-based sampling.
  • On the process level, select More () > OneAgent feature settings and select URL-based sampling.

Use case examples

The following rule reduces by 4 the capturing frequency of requests that start with _healthz.

  1. Go to Settings > Server-side service monitoring > URL-based sampling.
  2. Select Add URL.
  3. From Importance of a specific URL, select Reduce capturing by factor 2.
  4. Type the URL path /_healthz.
  5. From Path comparison condition, select Starts with.
  6. Turn on Any HTTP method.
  7. Select Save changes.

The following rule ignores all requests (starts with /) that have OPTIONS as HTTP method for a selected process group.

  1. Go to the process group and select More () > Process group settings > URL-based sampling.
  2. Select Add URL.
  3. Turn on Ignore a specific URL.
  4. Type the URL path /.
  5. From Path comparison condition, select Starts with.
  6. Turn off Any HTTP method.
  7. From the HTTP method list, turn on OPTIONS.
  8. Select Save changes.
  9. optional Create a new rule for each process group that you want to target.