envoyproxy/envoy
在 GitHub 查看Documentation: runtime tracing.random_sampling inaccurate with Datadog provider
Open
#24,180 创建于 2022年11月23日
area/tracingbughelp wantedpr/docs
仓库指标
- Star
- (27,997 star)
- PR 合并指标
- (平均合并 8天) (30 天内合并 378 个 PR)
描述
Title: Documentation: runtime tracing.random_sampling inaccurate
Description:
The Runtime documentation 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:
- Set runtime
tracing.random_samplingto any value over 100, e.g. 1000 - 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": "<AGENT IP>",
"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
}
}