From 23594890c22f557a30488497332f4c4ffca3afc9 Mon Sep 17 00:00:00 2001 From: Pierre Massat Date: Thu, 8 Dec 2022 13:46:52 -0500 Subject: [PATCH 1/2] fix(profiling): Warn on invalid JSON errors --- relay-profiling/src/outcomes.rs | 4 +++- relay-server/src/actors/processor.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/relay-profiling/src/outcomes.rs b/relay-profiling/src/outcomes.rs index 60e80419ef7..7326706e876 100644 --- a/relay-profiling/src/outcomes.rs +++ b/relay-profiling/src/outcomes.rs @@ -3,6 +3,9 @@ use crate::ProfileError; pub fn discard_reason(err: ProfileError) -> &'static str { match err { ProfileError::CannotSerializePayload => "profiling_failed_serialization", + ProfileError::InvalidBase64Value => "profiling_invalid_base64_value", + ProfileError::InvalidJson(_) => "profiling_invalid_json", + ProfileError::InvalidSampledProfile => "profiling_invalid_sampled_profile", ProfileError::InvalidTransactionMetadata => "profiling_invalid_transaction_metadata", ProfileError::MalformedSamples => "profiling_malformed_samples", ProfileError::MalformedStacks => "profiling_malformed_stacks", @@ -10,6 +13,5 @@ pub fn discard_reason(err: ProfileError) -> &'static str { ProfileError::NoTransactionAssociated => "profiling_no_transaction_associated", ProfileError::NotEnoughSamples => "profiling_not_enough_samples", ProfileError::PlatformNotSupported => "profiling_platform_not_supported", - _ => "profiling_unknown", } } diff --git a/relay-server/src/actors/processor.rs b/relay-server/src/actors/processor.rs index 1ee74ae8e4b..eeb12dd4cce 100644 --- a/relay-server/src/actors/processor.rs +++ b/relay-server/src/actors/processor.rs @@ -964,7 +964,7 @@ impl EnvelopeProcessorService { Err(err) => { match err { relay_profiling::ProfileError::InvalidJson(_) => { - relay_log::error!("invalid profile: {}", LogError(&err)); + relay_log::warn!("invalid profile: {}", LogError(&err)); } _ => relay_log::debug!("invalid profile: {}", err), }; From c6025c857ba7b75d98bb18ddfe3cf79b29ee13b3 Mon Sep 17 00:00:00 2001 From: Pierre Massat Date: Thu, 8 Dec 2022 13:48:49 -0500 Subject: [PATCH 2/2] Add PR to existing changelog entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c41f3d71af..465a925a2ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ - Track metrics for OpenTelemetry events. ([#1618](https://github.com/getsentry/relay/pull/1618)) - Normalize transaction name for URLs transaction source, by replacing UUIDs, SHAs and numerical IDs in transaction names by placeholders. ([#1621](https://github.com/getsentry/relay/pull/1621)) - Parse string as number to handle a release bug. ([#1637](https://github.com/getsentry/relay/pull/1637)) -- Expand Profiling's discard reasons. ([#1661](https://github.com/getsentry/relay/pull/1661)) +- Expand Profiling's discard reasons. ([#1661](https://github.com/getsentry/relay/pull/1661), [#1685](https://github.com/getsentry/relay/pull/1685)) - Allow to rate limit profiles on top of transactions. ([#1681](https://github.com/getsentry/relay/pull/1681)) ## 22.11.0