Skip to content

Commit

Permalink
Drop the profile when no sample were collected (#490)
Browse files Browse the repository at this point in the history
This strict check is already happening in Relay.
The idea is drop it on the client side to avoid waste of resources on Relay.
  • Loading branch information
viglia committed Jul 29, 2022
1 parent 2060a5b commit bdf0f17
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sentry-core/src/performance.rs
Expand Up @@ -433,7 +433,12 @@ impl Transaction {

#[cfg(all(feature = "profiling", not(target_os = "windows")))]
if let Some(profile) = profile {
envelope.add_item(profile);
if !profile.sampled_profile.samples.is_empty(){
envelope.add_item(profile);
}
else {
sentry_debug!("the profile is being dropped because it contains no samples");
}
}

client.send_envelope(envelope)
Expand Down

0 comments on commit bdf0f17

Please sign in to comment.