updated DroppedCount in BatchExportProcessor to use Volatile.Read() (#4302)

This commit is contained in:
Yun-Ting Lin 2023-03-14 12:17:59 -07:00 committed by GitHub
parent ac55f0e9a6
commit 849f8804f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -83,7 +83,7 @@ namespace OpenTelemetry
/// <summary>
/// Gets the number of telemetry objects dropped by the processor.
/// </summary>
internal long DroppedCount => this.droppedCount;
internal long DroppedCount => Volatile.Read(ref this.droppedCount);
/// <summary>
/// Gets the number of telemetry objects received by the processor.
@ -219,7 +219,7 @@ namespace OpenTelemetry
return false;
}
OpenTelemetrySdkEventSource.Log.DroppedExportProcessorItems(this.GetType().Name, this.exporter.GetType().Name, this.droppedCount);
OpenTelemetrySdkEventSource.Log.DroppedExportProcessorItems(this.GetType().Name, this.exporter.GetType().Name, this.DroppedCount);
if (timeoutMilliseconds == Timeout.Infinite)
{