Adaptive Traffic Management automatically starts sampling traces if the amount of ingested traces exceeds the included trace volume. In case of Extended trace ingest the threshold is increased but otherwise it works the same way.
If OneAgent capture rate is below 100%, sampling has been applied because the amount of traces that can be captured by OneAgent has exceeded the Full-Stack included trace volume.
You can adjust how OneAgent treats specific HTTP requests and Remote Procedure Call (RPC) requests when sampling is needed by
Configuring trace sampling for HTTP and RPC requests.
If OneAgent is sampling and the capture rate is below 100%, you can advise OneAgent on the importance of specific HTTP and RPC requests in relation to others. By increasing or decreasing the sampling frequency of certain HTTP and RPC requests, HTTP and RPC requests with higher importance are captured more often and vice versa. In this way you can control what the available trace volume is used for without affecting the overall ingested trace volume nor the overall capture rate.
Adjusting the capture rate is effective only if the OneAgent module that starts the distributed trace is sampling.
Excluding traces for specific HTTP and RPC requests from being captured.
In all environments, there are transactions for which traces are of lower value. You can exclude them from being captured at all. You can turn off tracing for specific HTTP and RPC requests completely at any time, freeing up trace volume for other more important requests.
Prerequisites
For HTTP requests trace sampling: OneAgent version 1.281+
For RPC requests trace samping: OneAgent version 1.307+
Available levels
You can configure trace sampling
For all traces in your environment
For traces started within a particular host group, process group, Kubernetes cluster, or Kubernetes namespace (Dynatrace version 1.312+). This is useful if you do not have environment permissions or simply want this to only effect a particular part of your environment.
Go to Settings > Server-side service monitoring.
Choose Trace sampling for HTTP Requests or Trace sampling for RPC Requests.
Go to Deployment Status and then select OneAgents.
On the OneAgent deployment page, turn off Show new OneAgent deployments.
Filter the table by Host group and select the host group you want to configure.
The Host group property is not displayed when the selected host doesn't belong to any host group.
This displays the OneAgent deployment page filtered by the selected host group. Each listed host has a Host group:<group name> link, where <group name> is the name of the host group that you want to configure.
Select the host group name in any row.
As you have filtered by host group, all displayed hosts go to the same host group.
Choose Trace sampling for HTTP Requests or Trace sampling for RPC Requests.
To find and select your process group do one of the following:
Go to Technologies & Processes or Technologies & Processes Classic (latest Dynatrace) and choose a technology.
Go to Hosts or Hosts Classic (latest Dynatrace) and choose a host.
Find and select your process group.
In the upper-right corner of the process-group overview page, select Settings.
Choose Trace sampling for HTTP Requests or Trace sampling for RPC Requests.
Go to Kubernetes or Kubernetes Classic (latest Dynatrace).
Find your Kubernetes cluster.
On the Kubernetes cluster overview,
To configure sampling for the cluster, in the upper-right corner, select More (…) > Settings.
To configure sampling for the namespace
Find and select the namespace.
In the upper-right corner of the Kubernetes namespace overview, select More (…) > Settings.
Choose Trace sampling for HTTP Requests or Trace sampling for RPC Requests.
Adjust sampling for web requests
Select Add URL.
Choose how to adjust trace sampling:
To never capture traces for the URL, regardless of the available trace volume, turn on Disable tracing for matching HTTP requests.
To increase or reduce the frequency of trace capture for the specific URL, set Importance of a specific URL to a different scaling factor.
To match the HTTP request do one or a combination of the following:
Enter the URL path and select the comparison condition.
Use wildcards (**) for URL paths with similar segments.
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.
Use query parameters.
Go to Query parameters and select Add item.
Enter a query parameter name.
Enter the query parameter value or turn on Query parameter value is undefined.
optional To apply the scaling factor to specific HTTP methods, turn off Any HTTP method and select the HTTP method(s) to target.
Select Save changes.
Select Add RPC.
Choose how to adjust trace sampling:
To never capture traces for the RPC, regardless of the available trace volume, turn on Disable tracing for matching RPC requests.
To increase or reduce the frequency of trace capture for the specific RPC, set Importance of a specific RPC to a different scaling factor.
Specify the Protocol.
To match the RPC request, enter the name and the comparison condition of one or a combination of the following paramters:
Remote operation name
Remote service name
Endpoint name
Select Save changes.
Use case examples
The following rule reduces the importance by 4 of requests that start with _healthz.
Go to Settings > Server-side service monitoring > Trace sampling for HTTP requests.
Select Add URL.
From Importance of a specific URL, select Reduce capturing by factor 4.
Type the URL path /_healthz.
From Path comparison condition, select Starts with.
Turn on Any HTTP method.
Select Save changes.
The following rule ignores all requests (starts with /) that have OPTIONS as HTTP method for a selected process group.
Go to the process group and select More (…) > Settings > Trace sampling for HTTP requests.
Select Add URL.
Turn on Ignore a specific URL.
Type the URL path /.
From Path comparison condition, select Starts with.
Turn off Any HTTP method.
From the HTTP method list, turn on OPTIONS.
Select Save changes.
optional Create a new rule for each process group that you want to target.