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.
Configuring adaptive sampling rules.
You can turn on Trace ingest control at a deployment scope level and change the multiplier for calculating the sampling threshold at that level. For details, see Adjust trace ingest sampling below.
You can configure trace sampling
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.
<group name> link, where <group name> is the name of the host group that you want to configure.
Technologies & Processes Classic and choose a technology.
Hosts Classic and choose a host.
Kubernetes Classic.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.
You can use trace ingest control to steer the usage of the Full-Stack Monitoring included trace volume at a settings scope level.
Typically, Adaptive Traffic Management distributes the available volume equally to all OneAgents. It achieves this by adjusting the trace ingest rate limit every 15 minutes, ensuring that the overall trace ingest volume remains within the included volume, along with any additional extended trace volume that has been configured.
With trace ingest control, you can adjust the trace ingest rate of OneAgents, allowing them to capture traces at a higher or lower rate than normal. This results in a higher trace capture rate for targeted parts of your system. Consequently, Adaptive Traffic Management might lower the trace ingest rate overall on average, so that the resulting overall trace ingest volume stays within the defined bounds
This control is available now via the Settings API. It will soon also be available in the Settings app directly.
To adjust trace ingest sampling, use the Trace Ingest Control schema provided by the Settings API. The following is general guidance for this setting.
builtin:trace.ingest.controladaptiveSamplingSwitch set to trueFor step-by-step details on using the API, see Example 3 and Example 4 in the use cases.
The following rule reduces the importance by 4 of requests that start with _healthz.
/_healthz.The following rule ignores all requests (starts with /) that have OPTIONS as HTTP method for a selected process group.
/.Go to Kubernetes (previous Dynatrace) or Kubernetes Classic.
Find your Kubernetes cluster and take the scope from the URL (for example, KUBERNETES_CLUSTER-1A2B3C4D5E6F7G8H)
Use POST objects to create a new settings object according to the following:
adaptiveTraceIngestRateFactor to 50.50 times to the default, which results in a higher capture rate while the overall trace ingest volume stays within the defined bounds.adaptiveSamplingSwitch to true.[{"schemaId": "builtin:trace.ingest.control","scope": "KUBERNETES_CLUSTER-1A2B3C4D5E6F7G8H","value": {"adaptiveSamplingSwitch": true,"adaptiveTraceIngestRateFactor": 50}}]
You should receive a successful response that provides you the objectId.
Optional Use GET effectiveValues to verify the change.
Go to Kubernetes (previous Dynatrace) or Kubernetes Classic.
Find your Kubernetes cluster.
Take the scope from the cluster of the URL (for example, KUBERNETES\CLUSTER-H8G7F6E5D4C3B2A1).
Use GET effectiveValues to check the value of adaptiveTraceIngestRateFactor, which is the currently effective adaptive trace ingest rate factor for this scope.
The response shows that it's currently already reduced to 0.8 for the scope/origin:
{"items": [{"origin": " KUBERNETES_CLUSTER-H8G7F6E5D4C3B2A1","value": {"adaptiveSamplingSwitch": true,"adaptiveTraceIngestRateFactor": 0.8}}],"totalCount": 1,"pageSize": 100}
Use GET objects to find the settings objectId for the scope.
Add the value "scope" to the fields query parameters.
Use PUT objects/{objectId} to update the existing settings object according to the following:
Set adaptiveTraceIngestRateFactor to 0.01.
This decreases the trace ingest rate limit to one percent of the default, resulting in a very low capture rate while the overall trace ingest volume stays within the defined bounds.
{"value": {"adaptiveSamplingSwitch": true,"adaptiveTraceIngestRateFactor": 0.01}}
You should receive a successful response that provides you the objectId.
Optional Use GET effectiveValues to verify the updated value of adaptiveTraceIngestRateFactor.