-
Notifications
You must be signed in to change notification settings - Fork 94
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
ref(project): Treat invalid project states as pending and unify state types #3770
Merged
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
dc191af
state -> info
jjbayer 23819cd
Split into ProjectFetchState and ProjectInfo
jjbayer 6354f02
wip
jjbayer b1b551e
wip
jjbayer 9eb1a3c
Merge remote-tracking branch 'origin/master' into ref/server-state-cl…
jjbayer c75f596
fix: limited config
jjbayer 2fe1ef8
wip
jjbayer d8e4661
wip
jjbayer d97864e
wip
jjbayer f54cc25
wip
jjbayer f144966
ref: check_envelope
jjbayer c26ab17
fix
jjbayer 41d5305
cargo check passes
jjbayer 6aadc85
it compiles
jjbayer 6e8730a
Merge remote-tracking branch 'origin/master' into ref/server-state-cl…
jjbayer 0f5a299
fix: lint
jjbayer ad97f80
fix: Initialize project with expired state.
jjbayer 0fefe75
Merge remote-tracking branch 'origin/master' into ref/server-state-cl…
jjbayer 72321f8
get rid of non_expired_state
jjbayer d9cb3dc
simplify
jjbayer da5a98e
rm unused function
jjbayer ab3384d
lint
jjbayer 8218dfc
fix: expiry
jjbayer 5abb665
fix: Parse disabled
jjbayer 90dffe2
ref: rm handle_processing
jjbayer 946939b
fix: Outcomes for disabled state
jjbayer 80f9ef8
Merge remote-tracking branch 'origin/master' into ref/server-state-cl…
jjbayer 97f67c1
fix: Check envelope
jjbayer a9622ea
fix: Keep scope when splitting envelope
jjbayer 2ba57c5
ref: metric_meta flush
jjbayer 4e54787
Merge remote-tracking branch 'origin/master' into ref/server-state-cl…
jjbayer 2d11c17
fix
jjbayer 41ac196
fix: Retry invalid
jjbayer 39c29ce
fix: Reject envelope
jjbayer e035308
Merge remote-tracking branch 'origin/master' into ref/server-state-cl…
jjbayer 0d89b86
fix
jjbayer b23ae22
fix: metric meta
jjbayer fb58fcd
doc
jjbayer 76bceb7
file structure
jjbayer 8cbf021
doc
jjbayer 5c50153
lint
jjbayer 3452ab1
Little things
jjbayer 96edc4e
feat: Use existing backoff loop for pending
jjbayer c49469d
Revert "feat: Use existing backoff loop for pending"
jjbayer 018e356
Use backoff loop for invalid
jjbayer c3ac129
doc
jjbayer e5e0b8a
Merge remote-tracking branch 'origin/master' into ref/server-state-cl…
jjbayer d5e984d
changelog
jjbayer 4baf239
ref: QueueKey
jjbayer f192372
ref: Move limited
jjbayer 1510b07
ref: review comments
jjbayer 8ffb253
lint: doc
jjbayer 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 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 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 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 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 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 |
---|---|---|
|
@@ -30,6 +30,7 @@ | |
//! | ||
//! ``` | ||
|
||
use relay_base_schema::project::ProjectKey; | ||
use std::borrow::Borrow; | ||
use std::collections::BTreeMap; | ||
use std::fmt; | ||
|
@@ -1218,6 +1219,24 @@ impl Envelope { | |
self.headers.sent_at | ||
} | ||
|
||
/// Returns the project key defined in the `trace` header of the envelope. | ||
/// | ||
/// This function returns `None` if: | ||
/// - there is no [`DynamicSamplingContext`] in the envelope headers. | ||
/// - there are no transactions or events in the envelope, since in this case sampling by trace is redundant. | ||
pub fn sampling_key(&self) -> Option<ProjectKey> { | ||
// If the envelope item is not of type transaction or event, we will not return a sampling key | ||
// because it doesn't make sense to load the root project state if we don't perform trace | ||
// sampling. | ||
self.get_item_by(|item| { | ||
matches!( | ||
item.ty(), | ||
ItemType::Transaction | ItemType::Event | ItemType::Span | ||
) | ||
})?; | ||
self.dsc().map(|dsc| dsc.public_key) | ||
} | ||
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. I needed a |
||
|
||
/// Sets the event id on the envelope. | ||
pub fn set_event_id(&mut self, event_id: EventId) { | ||
self.headers.event_id = Some(event_id); | ||
|
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously the split-out envelope was scoped by a call to
check_envelope
inhandle_processing
. That function takes a validProjectInfo
now, so we have to do it here.