-
Notifications
You must be signed in to change notification settings - Fork 93
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
feat(metrics): Add received_at timestamp in bucket metadata #3488
Merged
Merged
Changes from 9 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
f8ab10c
feat(metrics): Add received_at timestamp in bucket metadata
iambriccardo 9d51e9f
Fix
iambriccardo 85c7dcb
Fix
iambriccardo d07aa34
Fix
iambriccardo 9966952
Fix
iambriccardo d341e53
Add logic
iambriccardo 5649429
Refactor tests
iambriccardo b520960
Fix
iambriccardo adab977
Fix
iambriccardo 8ee95c5
Fix
iambriccardo 640a26d
Merge branch 'master' into riccardo/feat/add-timestamp
iambriccardo 0e61ac1
Add test
iambriccardo a7d50f0
Fix
iambriccardo 7766480
Fix
iambriccardo 20bd2eb
Revert
iambriccardo 3a12653
Fix
iambriccardo 35a69cc
Fix
iambriccardo 4d51d41
Update changelog
iambriccardo f80c03f
Merge
iambriccardo 072f96e
Fix
iambriccardo 9519e31
Improv
iambriccardo 8ebdd62
Remove
iambriccardo d0d1b1e
Merge
iambriccardo b83fa01
Cleanup
iambriccardo 24fc67f
Fix tests
iambriccardo 5c5680b
Rename
iambriccardo 768eae6
Rename
iambriccardo f9bdf3f
Rename
iambriccardo cc1b985
Remove
iambriccardo 22443d0
Add back snapshots
iambriccardo c4b0b13
Merge branch 'master' into riccardo/feat/add-timestamp
jan-auer 0244cb6
fix: More snapshots
jan-auer 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -524,13 +524,17 @@ struct SentryMetrics { | |
/// | ||
/// Defaults to 5. | ||
pub meta_locations_max: usize, | ||
/// Whether to override the [`received_at`] field in the [`BucketMetadata`] with the current | ||
/// receive time of the instance. | ||
pub override_received_at_metadata: bool, | ||
} | ||
|
||
impl Default for SentryMetrics { | ||
fn default() -> Self { | ||
Self { | ||
meta_locations_expiry: 15 * 24 * 60 * 60, | ||
meta_locations_max: 5, | ||
override_received_at_metadata: false, | ||
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. By default we do not want to override the metadata to avoid unexpected behaviors due to the missing config param. |
||
} | ||
} | ||
} | ||
|
@@ -1947,6 +1951,11 @@ impl Config { | |
Duration::from_secs(self.values.sentry_metrics.meta_locations_expiry) | ||
} | ||
|
||
/// Returns whether we want to override the [`received_at`] field of [`BucketMetadata`]. | ||
pub fn metrics_override_received_at_metadata(&self) -> bool { | ||
self.values.sentry_metrics.override_received_at_metadata | ||
} | ||
|
||
/// Returns the default timeout for all upstream HTTP requests. | ||
pub fn http_timeout(&self) -> Duration { | ||
Duration::from_secs(self.values.http.timeout.into()) | ||
|
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
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.
In production, we would like to set this option to true only for pop relays, since we want to have the
received_at
metadata field set to the outermost relay timestamp that receives a given bucket.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.
We already have that handling in the processor as
keep_metadata
for example inhandle_process_metrics
which should already do the right thing.