From b45b8a9a1272ea91924cc644fd6765ed44778ec6 Mon Sep 17 00:00:00 2001 From: ImoutoChan Date: Tue, 31 Oct 2023 06:19:14 +0300 Subject: [PATCH] Check isSampled parameter in UpdateWithExemplar method (#5004) --- src/OpenTelemetry/CHANGELOG.md | 4 +++ src/OpenTelemetry/Metrics/MetricPoint.cs | 44 +++++++++++++++--------- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/src/OpenTelemetry/CHANGELOG.md b/src/OpenTelemetry/CHANGELOG.md index 30856d74dfc..e5d3afac461 100644 --- a/src/OpenTelemetry/CHANGELOG.md +++ b/src/OpenTelemetry/CHANGELOG.md @@ -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 diff --git a/src/OpenTelemetry/Metrics/MetricPoint.cs b/src/OpenTelemetry/Metrics/MetricPoint.cs index 48f726f4754..831f027b3eb 100644 --- a/src/OpenTelemetry/Metrics/MetricPoint.cs +++ b/src/OpenTelemetry/Metrics/MetricPoint.cs @@ -499,11 +499,14 @@ internal void UpdateWithExemplar(long number, ReadOnlySpan