open-telemetry / opentelemetry-rust

The Rust OpenTelemetry implementation
https://opentelemetry.io
Apache License 2.0
1.82k stars 423 forks source link

Tracer does weak->Arc upgrade twice in hot path leading to bottleneck #1801

Open cijothomas opened 4 months ago

cijothomas commented 4 months ago

Tracer holds a weakref to its TracerProvider and attempts to upgrade that to an Arc twice in the hot path - one during span start and then again during span end. This is affecting throughput due to contention.

This issue is already fixed for Logs, opening a new issue to track fixing the same for traces.

TommyCpp commented 4 months ago

Will take a look this week

TommyCpp commented 4 months ago
  1. Make the span processor shutdown from any reference #1836
  2. Add shutdown to sdk tracer provider #1855
  3. Remove global::shutdown_global_tracer_provider
  4. Now tracer provider can take a TracerProviderInner Arc pointer. #1855