diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d2e2c6b5f..17ab753626 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ If you have conflicts, you can opt-out by adding the following to your `csproj`: ### Fixes +- Fixed an issue with tag values in metrics not being properly serialized ([#3065](https://github.com/getsentry/sentry-dotnet/pull/3065)) - Moved the binding to MAUI events for breadcrumb creation from `WillFinishLaunching` to `FinishedLaunching`. This delays the initial instantiation of `app`. ([#3057](https://github.com/getsentry/sentry-dotnet/pull/3057)) - The SDK no longer adds the `WinUIUnhandledExceptionIntegration` on non Windows platforms ([#3055](https://github.com/getsentry/sentry-dotnet/pull/3055)) - The scope transaction is now correctly set for Otel transactions ([#3072](https://github.com/getsentry/sentry-dotnet/pull/3072)) diff --git a/src/Sentry/Protocol/Metrics/Metric.cs b/src/Sentry/Protocol/Metrics/Metric.cs index 7a9a5ca737..801f3c9173 100644 --- a/src/Sentry/Protocol/Metrics/Metric.cs +++ b/src/Sentry/Protocol/Metrics/Metric.cs @@ -97,7 +97,7 @@ public async Task SerializeAsync(Stream stream, IDiagnosticLogger? logger, Cance { await Write(","); } - await Write($"{key}:SanitizeValue(value)"); + await Write($"{key}:{MetricHelper.SanitizeValue(value)}"); } } diff --git a/test/Sentry.Tests/MetricTests.SerializeAsync_WritesMetric_metric=CounterMetric.verified.txt b/test/Sentry.Tests/MetricTests.SerializeAsync_WritesMetric_metric=CounterMetric.verified.txt index 07089ed3ee..ea8d4682d7 100644 --- a/test/Sentry.Tests/MetricTests.SerializeAsync_WritesMetric_metric=CounterMetric.verified.txt +++ b/test/Sentry.Tests/MetricTests.SerializeAsync_WritesMetric_metric=CounterMetric.verified.txt @@ -1 +1 @@ -my.counter@counters:5|c|#tag1:SanitizeValue(value),tag2:SanitizeValue(value)|T1577836800 +my.counter@counters:5|c|#tag1:value1,tag2:value2|T1577836800 diff --git a/test/Sentry.Tests/MetricTests.SerializeAsync_WritesMetric_metric=DistributionMetric.verified.txt b/test/Sentry.Tests/MetricTests.SerializeAsync_WritesMetric_metric=DistributionMetric.verified.txt index f6a5cd69e2..6b7993edbb 100644 --- a/test/Sentry.Tests/MetricTests.SerializeAsync_WritesMetric_metric=DistributionMetric.verified.txt +++ b/test/Sentry.Tests/MetricTests.SerializeAsync_WritesMetric_metric=DistributionMetric.verified.txt @@ -1 +1 @@ -my.distribution@distributions:5:7:13|d|#tag1:SanitizeValue(value),tag2:SanitizeValue(value)|T1577836800 +my.distribution@distributions:5:7:13|d|#tag1:value1,tag2:value2|T1577836800 diff --git a/test/Sentry.Tests/MetricTests.SerializeAsync_WritesMetric_metric=GaugeMetric.verified.txt b/test/Sentry.Tests/MetricTests.SerializeAsync_WritesMetric_metric=GaugeMetric.verified.txt index ed798ecca2..75933143c7 100644 --- a/test/Sentry.Tests/MetricTests.SerializeAsync_WritesMetric_metric=GaugeMetric.verified.txt +++ b/test/Sentry.Tests/MetricTests.SerializeAsync_WritesMetric_metric=GaugeMetric.verified.txt @@ -1 +1 @@ -my.gauge@gauges:7:5:7:12:2|g|#tag1:SanitizeValue(value),tag2:SanitizeValue(value)|T1577836800 +my.gauge@gauges:7:5:7:12:2|g|#tag1:value1,tag2:value2|T1577836800 diff --git a/test/Sentry.Tests/MetricTests.SerializeAsync_WritesMetric_metric=SetMetric.verified.txt b/test/Sentry.Tests/MetricTests.SerializeAsync_WritesMetric_metric=SetMetric.verified.txt index d147d1fc26..ef8c8ebd3b 100644 --- a/test/Sentry.Tests/MetricTests.SerializeAsync_WritesMetric_metric=SetMetric.verified.txt +++ b/test/Sentry.Tests/MetricTests.SerializeAsync_WritesMetric_metric=SetMetric.verified.txt @@ -1 +1 @@ -my.set@sets:5:7|s|#tag1:SanitizeValue(value),tag2:SanitizeValue(value)|T1577836800 +my.set@sets:5:7|s|#tag1:value1,tag2:value2|T1577836800