-
Notifications
You must be signed in to change notification settings - Fork 112
ref(standalone): Remove old processing code #5805
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
Open
tobias-wilfert
wants to merge
4
commits into
master
Choose a base branch
from
tobias-wilfert/feat/remove-standalone-processor
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,14 +91,11 @@ use { | |
| pub mod event; | ||
| mod metrics; | ||
| mod nel; | ||
| mod profile; | ||
| mod report; | ||
| #[cfg(feature = "processing")] | ||
| mod span; | ||
|
|
||
| #[cfg(all(sentry, feature = "processing"))] | ||
| pub mod playstation; | ||
| mod standalone; | ||
|
|
||
| /// Creates the block only if used with `processing` feature. | ||
| /// | ||
|
|
@@ -169,13 +166,6 @@ processing_group!(TransactionGroup, Transaction); | |
| processing_group!(ErrorGroup, Error); | ||
|
|
||
| processing_group!(SessionGroup, Session); | ||
| processing_group!( | ||
| StandaloneGroup, | ||
| Standalone, | ||
| StandaloneAttachments, | ||
| StandaloneUserReports, | ||
| StandaloneProfiles | ||
| ); | ||
| processing_group!(ClientReportGroup, ClientReport); | ||
| processing_group!(ReplayGroup, Replay); | ||
| processing_group!(CheckInGroup, CheckIn); | ||
|
|
@@ -208,9 +198,6 @@ pub enum ProcessingGroup { | |
| Error, | ||
| /// Session events. | ||
| Session, | ||
| /// Standalone items which can be sent alone without any event attached to it in the current | ||
| /// envelope e.g. some attachments, user reports. | ||
| Standalone, | ||
| /// Standalone attachments | ||
| /// | ||
| /// Attachments that are send without an item that creates an event in the same envelope. | ||
|
|
@@ -404,20 +391,6 @@ impl ProcessingGroup { | |
| } | ||
| } | ||
|
|
||
| // Extract all standalone items. | ||
| // | ||
| // Note: only if there are no items in the envelope which can create events, otherwise they | ||
| // will be in the same envelope with all require event items. | ||
| if !envelope.items().any(Item::creates_event) { | ||
| let standalone_items = envelope.take_items_by(Item::requires_event); | ||
| if !standalone_items.is_empty() { | ||
| grouped_envelopes.push(( | ||
| ProcessingGroup::Standalone, | ||
| Envelope::from_parts(headers.clone(), standalone_items), | ||
| )) | ||
| } | ||
| }; | ||
|
|
||
tobias-wilfert marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // Make sure we create separate envelopes for each `RawSecurity` report. | ||
| let security_reports_items = envelope | ||
| .take_items_by(|i| matches!(i.ty(), &ItemType::RawSecurity)) | ||
tobias-wilfert marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
@@ -479,7 +452,6 @@ impl ProcessingGroup { | |
| ProcessingGroup::Transaction => "transaction", | ||
| ProcessingGroup::Error => "error", | ||
| ProcessingGroup::Session => "session", | ||
| ProcessingGroup::Standalone => "standalone", | ||
| ProcessingGroup::StandaloneAttachments => "standalone_attachment", | ||
| ProcessingGroup::StandaloneUserReports => "standalone_user_reports", | ||
| ProcessingGroup::StandaloneProfiles => "standalone_profiles", | ||
|
|
@@ -506,7 +478,6 @@ impl From<ProcessingGroup> for AppFeature { | |
| ProcessingGroup::Transaction => AppFeature::Transactions, | ||
| ProcessingGroup::Error => AppFeature::Errors, | ||
| ProcessingGroup::Session => AppFeature::Sessions, | ||
| ProcessingGroup::Standalone => AppFeature::UnattributedEnvelope, | ||
| ProcessingGroup::StandaloneAttachments => AppFeature::UnattributedEnvelope, | ||
| ProcessingGroup::StandaloneUserReports => AppFeature::UserReports, | ||
| ProcessingGroup::StandaloneProfiles => AppFeature::Profiles, | ||
|
|
@@ -604,6 +575,9 @@ pub enum ProcessingError { | |
| #[cfg(feature = "processing")] | ||
| #[error("invalid attachment reference")] | ||
| InvalidAttachmentRef, | ||
|
|
||
| #[error("could not determine processing group for envelope items")] | ||
| NoProcessingGroup, | ||
| } | ||
|
|
||
| impl ProcessingError { | ||
|
|
@@ -650,6 +624,7 @@ impl ProcessingError { | |
| Self::InvalidAttachmentRef => { | ||
| Some(Outcome::Invalid(DiscardReason::InvalidAttachmentRef)) | ||
| } | ||
| Self::NoProcessingGroup => Some(Outcome::Invalid(DiscardReason::Internal)), | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -845,17 +820,6 @@ fn send_metrics( | |
| } | ||
| } | ||
|
|
||
| /// Function for on-off switches that filter specific item types (profiles, spans) | ||
| /// based on a feature flag. | ||
| /// | ||
| /// If the project config did not come from the upstream, we keep the items. | ||
| fn should_filter(config: &Config, project_info: &ProjectInfo, feature: Feature) -> bool { | ||
| match config.relay_mode() { | ||
| RelayMode::Proxy => false, | ||
| RelayMode::Managed => !project_info.has_feature(feature), | ||
| } | ||
| } | ||
|
|
||
| /// The result of the envelope processing containing the processed envelope along with the partial | ||
| /// result. | ||
| #[derive(Debug)] | ||
|
|
@@ -1348,44 +1312,6 @@ impl EnvelopeProcessorService { | |
| } else { Ok(cached_result.event) }) | ||
| } | ||
|
|
||
| /// Processes standalone items that require an event ID, but do not have an event on the same envelope. | ||
| async fn process_standalone( | ||
| &self, | ||
| managed_envelope: &mut TypedEnvelope<StandaloneGroup>, | ||
| ctx: processing::Context<'_>, | ||
| ) -> Result<Option<ProcessingExtractedMetrics>, ProcessingError> { | ||
| for item in managed_envelope.envelope().items() { | ||
| let attachment_type_tag = match item.attachment_type() { | ||
| Some(t) => &t.to_string(), | ||
| None => "", | ||
| }; | ||
| relay_statsd::metric!( | ||
| counter(RelayCounters::StandaloneItem) += 1, | ||
| processor = "old", | ||
| item_type = item.ty().name(), | ||
| attachment_type = attachment_type_tag, | ||
| ); | ||
| } | ||
|
|
||
| let mut extracted_metrics = ProcessingExtractedMetrics::new(); | ||
|
|
||
| standalone::process(managed_envelope); | ||
|
|
||
| profile::filter(managed_envelope, ctx.config, ctx.project_info); | ||
|
|
||
| self.enforce_quotas( | ||
| managed_envelope, | ||
| Annotated::empty(), | ||
| &mut extracted_metrics, | ||
| ctx, | ||
| ) | ||
| .await?; | ||
|
|
||
| report::process_user_reports(managed_envelope); | ||
|
|
||
| Ok(Some(extracted_metrics)) | ||
| } | ||
|
|
||
| async fn process_nel( | ||
| &self, | ||
| mut managed_envelope: ManagedEnvelope, | ||
|
|
@@ -1552,7 +1478,6 @@ impl EnvelopeProcessorService { | |
| self.process_with_processor(&self.inner.processing.sessions, managed_envelope, ctx) | ||
| .await | ||
| } | ||
| ProcessingGroup::Standalone => run!(process_standalone, ctx), | ||
| ProcessingGroup::StandaloneAttachments => { | ||
| self.process_with_processor( | ||
| &self.inner.processing.attachments, | ||
|
|
@@ -1647,9 +1572,7 @@ impl EnvelopeProcessorService { | |
| "could not identify the processing group based on the envelope's items" | ||
| ); | ||
|
|
||
| Ok(ProcessingResult::no_metrics( | ||
| managed_envelope.into_processed(), | ||
| )) | ||
| Err(ProcessingError::NoProcessingGroup) | ||
|
Comment on lines
-1650
to
+1575
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The one "new" logic: We don't forward ungrouped but rather error out here. |
||
| } | ||
| // Leave this group unchanged. | ||
| // | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.