Skip to content

Commit

Permalink
fix(profiling): Warn on invalid JSON errors (#1685)
Browse files Browse the repository at this point in the history
  • Loading branch information
phacops authored Dec 8, 2022
1 parent 1c32ce2 commit aeab49e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,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
Expand Down
4 changes: 3 additions & 1 deletion relay-profiling/src/outcomes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ 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",
ProfileError::MissingProfileMetadata => "profiling_invalid_profile_metadata",
ProfileError::NoTransactionAssociated => "profiling_no_transaction_associated",
ProfileError::NotEnoughSamples => "profiling_not_enough_samples",
ProfileError::PlatformNotSupported => "profiling_platform_not_supported",
_ => "profiling_unknown",
}
}
2 changes: 1 addition & 1 deletion relay-server/src/actors/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};
Expand Down

0 comments on commit aeab49e

Please sign in to comment.