Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Sanitize value in metrics #3065

Merged
merged 3 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion src/Sentry/Protocol/Metrics/Metric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)}");
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
my.counter@counters:5|c|#tag1:SanitizeValue(value),tag2:SanitizeValue(value)|T1577836800
my.counter@counters:5|c|#tag1:value1,tag2:value2|T1577836800
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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