Documentation: runtime tracing.random_sampling inaccurate with Datadog provider
- Dominant language
- C++
- Stars
- 28.9k
- Forks
- 5.6k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 437
Description
*Title*: *Documentation: runtime tracing.random_sampling inaccurate*
*Description*:
The [Runtime documentation](https://www.envoyproxy.io/docs/envoy/v1.20.0/configuration/http/http_conn_man/runtime#config-http-conn-man-runtime-random-sampling) for `tracing.random_sampling` states that the value should be between 0-10000, however in my testing it seems that in reality, any value >= 100 will result in all requests emitting traces. Note: I have only been able to test with the Datadog trace provider, as that is what I have setup to use, so I can't confirm whether this is isolated to the Datadog provider or not.
*Repro steps*:
1. Set runtime ` tracing.random_sampling` to any value over 100, e.g. 1000
2. Send a couple requests and note that envoy emits a trace for all of them, when according to the documentation it should only emit 10% (10000/1000)
*Config*:
(Only including the relevant config snippets)
```
"tracing": {
"http": {
"name": "envoy.tracers.datadog",
"typed_config": {
"@type": "type.googleapis.com/envoy.config.trace.v3.DatadogConfig",
"collector_cluster": "datadog_agent",
"service_name": "envoy-sidecar"
}
}
},
...
"layered_runtime": {
"layers": [
{
"name": "static_layer_0",
"static_layer": {
"tracing": {
"random_sampling": 1000
}
}
}
]
}
...
"clusters": [
{
"name": "datadog_agent",
"type": "STATIC",
"connect_timeout": "0.250s",
"load_assignment": {
"cluster_name": "datadog_agent",
"endpoints": [
{
"lb_endpoints": [
{
"endpoint": {
"address": {
"socket_address": {
"address": "",
"port_value": 8126
}
}
}
}
]
}
]
}
}
]
```
And an example HTTP connection manager config:
```
{
"name": "envoy.http_connection_manager",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
"stat_prefix": "REDACTED",
"rds": {
"config_source": {
"ads": {},
"resource_api_version": "V3"
},
"route_config_name": "REDACTED"
},
"http_filters": [
{
"name": "envoy.filters.http.fault",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.fault.v3.HTTPFault"
}
},
{
"name": "envoy.filters.http.cors",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors"
}
},
{
"name": "envoy.filters.http.router",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router",
"suppress_envoy_headers": true
}
}
],
"tracing": {},
"use_remote_address": true,
"generate_request_id": true,
"normalize_path": true,
"merge_slashes": true
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.