Check isSampled parameter in UpdateWithExemplar method (#5004)
This commit is contained in:
parent
86a6ba0b7f
commit
b45b8a9a12
|
|
@ -11,6 +11,10 @@
|
|||
`autoGenerateServiceInstanceId` is `true`.
|
||||
([#4988](https://github.com/open-telemetry/opentelemetry-dotnet/pull/4988))
|
||||
|
||||
* Fixed a bug where isSampled parameter wasn't properly checked in certain cases
|
||||
within the `UpdateWithExemplar` method of `MetricPoint`.
|
||||
([#4851](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5004))
|
||||
|
||||
## 1.7.0-alpha.1
|
||||
|
||||
Released 2023-Oct-16
|
||||
|
|
|
|||
|
|
@ -499,11 +499,14 @@ public struct MetricPoint
|
|||
|
||||
this.runningValue.AsLong = number;
|
||||
|
||||
Debug.Assert(this.mpComponents.ExemplarReservoir != null, "ExemplarReservoir was null");
|
||||
if (isSampled)
|
||||
{
|
||||
Debug.Assert(this.mpComponents.ExemplarReservoir != null, "ExemplarReservoir was null");
|
||||
|
||||
// TODO: Need to ensure that the lock is always released.
|
||||
// A custom implementation of `ExemplarReservoir.Offer` might throw an exception.
|
||||
this.mpComponents.ExemplarReservoir!.Offer(number, tags);
|
||||
// TODO: Need to ensure that the lock is always released.
|
||||
// A custom implementation of `ExemplarReservoir.Offer` might throw an exception.
|
||||
this.mpComponents.ExemplarReservoir!.Offer(number, tags);
|
||||
}
|
||||
|
||||
ReleaseLock(ref this.mpComponents!.IsCriticalSectionOccupied);
|
||||
|
||||
|
|
@ -516,11 +519,14 @@ public struct MetricPoint
|
|||
|
||||
this.runningValue.AsLong = number;
|
||||
|
||||
Debug.Assert(this.mpComponents.ExemplarReservoir != null, "ExemplarReservoir was null");
|
||||
if (isSampled)
|
||||
{
|
||||
Debug.Assert(this.mpComponents.ExemplarReservoir != null, "ExemplarReservoir was null");
|
||||
|
||||
// TODO: Need to ensure that the lock is always released.
|
||||
// A custom implementation of `ExemplarReservoir.Offer` might throw an exception.
|
||||
this.mpComponents.ExemplarReservoir!.Offer(number, tags);
|
||||
// TODO: Need to ensure that the lock is always released.
|
||||
// A custom implementation of `ExemplarReservoir.Offer` might throw an exception.
|
||||
this.mpComponents.ExemplarReservoir!.Offer(number, tags);
|
||||
}
|
||||
|
||||
ReleaseLock(ref this.mpComponents!.IsCriticalSectionOccupied);
|
||||
|
||||
|
|
@ -717,11 +723,14 @@ public struct MetricPoint
|
|||
this.runningValue.AsDouble = number;
|
||||
}
|
||||
|
||||
Debug.Assert(this.mpComponents.ExemplarReservoir != null, "ExemplarReservoir was null");
|
||||
if (isSampled)
|
||||
{
|
||||
Debug.Assert(this.mpComponents.ExemplarReservoir != null, "ExemplarReservoir was null");
|
||||
|
||||
// TODO: Need to ensure that the lock is always released.
|
||||
// A custom implementation of `ExemplarReservoir.Offer` might throw an exception.
|
||||
this.mpComponents.ExemplarReservoir!.Offer(number, tags);
|
||||
// TODO: Need to ensure that the lock is always released.
|
||||
// A custom implementation of `ExemplarReservoir.Offer` might throw an exception.
|
||||
this.mpComponents.ExemplarReservoir!.Offer(number, tags);
|
||||
}
|
||||
|
||||
ReleaseLock(ref this.mpComponents!.IsCriticalSectionOccupied);
|
||||
|
||||
|
|
@ -737,11 +746,14 @@ public struct MetricPoint
|
|||
this.runningValue.AsDouble = number;
|
||||
}
|
||||
|
||||
Debug.Assert(this.mpComponents.ExemplarReservoir != null, "ExemplarReservoir was null");
|
||||
if (isSampled)
|
||||
{
|
||||
Debug.Assert(this.mpComponents.ExemplarReservoir != null, "ExemplarReservoir was null");
|
||||
|
||||
// TODO: Need to ensure that the lock is always released.
|
||||
// A custom implementation of `ExemplarReservoir.Offer` might throw an exception.
|
||||
this.mpComponents.ExemplarReservoir!.Offer(number, tags);
|
||||
// TODO: Need to ensure that the lock is always released.
|
||||
// A custom implementation of `ExemplarReservoir.Offer` might throw an exception.
|
||||
this.mpComponents.ExemplarReservoir!.Offer(number, tags);
|
||||
}
|
||||
|
||||
ReleaseLock(ref this.mpComponents!.IsCriticalSectionOccupied);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue