[StackExchange.Redis] Improved performance of Redis command draining by matt-hensley · Pull Request #4398 · open-telemetry/opentelemetry-dotnet-contrib (original) (raw)

Fixes #4083

Changes

Adds an optimized path to flush profiled Redis commands on every FlushInterval tick regardless whether the parent Activity completes.

Whether this new optimized path is used depends on instrumentation configuration.

If both Enrich and Filter are not set, commands are flushed without waiting for the parent Activity to complete. For long-lived or high-volume parent spans this can alleviate memory pressure as seen in #4083.

if Enrich or Filter is set, commands are buffered until the parent Activity completes. The parameters for these two callbacks have historically received a completed parent Activity. This way, the previous behavior is maintained, avoiding a potential breaking change.

Merge requirement checklist