opentelemetry-rust
opentelemetry-rust copied to clipboard
Log Benchmarks are repeatedily creating LogProviders
As https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry-sdk/benches/log.rs#L52 line is executed repeatedly for each iteration, the cost that the benchmark measures include the cost of creating Provider itself. It could be minor, but we should only be testing the true of Log emit only, as creating LoggerProvider, Logger is one time, and emission is the repeating code for end users.
Similar issue was noted in metrics and fixed : https://github.com/open-telemetry/opentelemetry-rust/pull/1991
We need to review every benchmarks to fix this issue, but priority is to get the log ones fixed, so it is easily to measure the impact of all the active work on improving Log performance @lalitb is doing. Hopefully, this can also reduce the noise/variations we are observing making it difficult to compare gains.