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: Remove profiling feature flag #2146

Merged
merged 2 commits into from
May 23, 2023
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 @@ -5,6 +5,7 @@
**Bug Fixes**:

- Sample only transaction events instead of sampling both transactions and errors. ([#2130](https://github.com/getsentry/relay/pull/2130))
- Remove profiling feature flag. ([#2146](https://github.com/getsentry/relay/pull/2146))

**Internal**:

Expand Down
4 changes: 0 additions & 4 deletions relay-dynamic-config/src/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use serde::{Deserialize, Serialize};
/// Features exposed by project config.
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Hash)]
pub enum Feature {
/// Enables ingestion and normalization of profiles.
Profiling,
/// Enables ingestion of Session Replays (Replay Recordings and Replay Events).
SessionReplay,
/// Enables data scrubbing of replay recording payloads.
Expand All @@ -28,7 +26,6 @@ impl<'de> Deserialize<'de> for Feature {
{
let feature_name = Cow::<str>::deserialize(deserializer)?;
Ok(match feature_name.as_ref() {
"organizations:profiling" => Feature::Profiling,
"organizations:session-replay" => Feature::SessionReplay,
"organizations:session-replay-recording-scrubbing" => {
Feature::SessionReplayRecordingScrubbing
Expand All @@ -46,7 +43,6 @@ impl Serialize for Feature {
S: serde::Serializer,
{
serializer.serialize_str(match self {
Feature::Profiling => "organizations:profiling",
Feature::SessionReplay => "organizations:session-replay",
Feature::SessionReplayRecordingScrubbing => {
"organizations:session-replay-recording-scrubbing"
Expand Down
18 changes: 7 additions & 11 deletions relay-server/src/actors/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1044,19 +1044,15 @@ impl EnvelopeProcessorService {
}
}

/// Remove profiles from the envelope if the feature flag is not enabled.
/// Remove profiles from the envelope if they can not be parsed
fn filter_profiles(&self, state: &mut ProcessEnvelopeState) {
let profiling_enabled = state.project_state.has_feature(Feature::Profiling);
state.managed_envelope.retain_items(|item| match item.ty() {
ItemType::Profile if !profiling_enabled => ItemAction::DropSilently,
ItemType::Profile if profiling_enabled => {
match relay_profiling::parse_metadata(&item.payload()) {
Ok(_) => ItemAction::Keep,
Err(err) => ItemAction::Drop(Outcome::Invalid(DiscardReason::Profiling(
relay_profiling::discard_reason(err),
))),
}
}
ItemType::Profile => match relay_profiling::parse_metadata(&item.payload()) {
Ok(_) => ItemAction::Keep,
Err(err) => ItemAction::Drop(Outcome::Invalid(DiscardReason::Profiling(
relay_profiling::discard_reason(err),
))),
},
_ => ItemAction::Keep,
});
}
Expand Down
Loading