opentelemetrytracer: allow configuring `flush_interval_ms` and `min_flush_spans` with tracer config
- Dominant language
- C++
- Stars
- 28.9k
- Forks
- 5.6k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 437
Description
*Title*: allow configuring `flush_interval_ms` and `min_flush_spans` with tracer config
*Description*:
The OpenTelemetry tracer has two runtime settings that control the behavior of when spans are exported. One is `flush_interval_ms` which controls the timeout for a export to happen and the other is `min_flush_spans` which controls the size of the batch to trigger also a export.
Both of these today need to be enabled via the [runtime config](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/operations/runtime). I may be lacking context but when using Istio, to be able to change these I would need to deploy a `ConfigMap` and add a annotation to all my pods in order for Istio to know that it needs to "merge" this config when injecting the sidecar proxies.
I'm not sure if deploying configmaps is a common thing and users are used to it, but as a OpenTelemetry contributor/user, such configurations are part of the "SDK" configuration. For ex, the [batch processor](https://opentelemetry.io/docs/specs/otel/trace/sdk/#batching-processor) has similar parameters. Similarly, the OTel collector also [has the same](https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/batchprocessor/README.md).
So I thought Envoy could also expose these two properties as part of the "normal" OTel tracer:
```
provider:
name: envoy.tracers.opentelemetry
typed_config:
"@type": type.googleapis.com/envoy.config.trace.v3.OpenTelemetryConfig
service_name: envoy-HTTP-exporter
[other config]
flush_interval_ms: 6000 <<<<<< NEW
min_flush_spans: 512 <<<<<< NEW
```
[optional *Relevant Links*:]
https://github.com/envoyproxy/envoy/issues/35997#issuecomment-2388492731
Contributor guide
Assessment
This issue has not been assessed yet.