-
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
feat(outcomes): Emit outcomes as client reports [INGEST-247] #1119
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
57ff26e
wip
jjbayer 4fad457
wip
jjbayer ed93929
wip
jjbayer 64d6d5f
fix: processing flow
jjbayer 2bdab2c
wip
jjbayer a519519
feat(outcomes): Aggregate client reports in outcome aggregator
jjbayer e15501f
test: Test aggregation in integration test
jjbayer 9496481
ref: Cleanup + doc
jjbayer c2dd6ea
Add statsd metric for outcome aggregator flush time
jjbayer 91a631c
ref: Remove old comment
jjbayer 64749c0
fix: Increase mailbox size
jjbayer e0214ed
Add changelog
jjbayer 29581bc
ref: Use or_default instead of or_insert_with
jjbayer d9a2ad9
Merge branch 'feat/aggregate-client-reports' into feat/outcomes-as-cl…
jjbayer 2d73cee
feat: Make aggregation a noop if event_id is set
jjbayer d5556a9
feat: Send client report envelopes from outcomes
jjbayer 20e01de
wip
jjbayer f6179bc
feat: Add outcome to client reports
jjbayer e9741f9
feat: Disable outcome aggregator if not needed
jjbayer 01c034a
feat: Erase event_id and remote_addr for lossy outcome aggregation
jjbayer 73681af
Remove Accepted variant of Outcome enum
jjbayer e97d4b6
wip
jjbayer 19c9333
test: Use dynamic sampling in integration test
jjbayer 3f9c410
Merge branch 'master' into feat/outcomes-as-client-reports-original
jjbayer bc2c141
ref(config): tri-state emit outcomes config
jjbayer 85a6587
ref: cleanup
jjbayer 5646935
Add statsd tag name for client reports
jjbayer c73e9f5
ref: Add new fields to client report (one per outcome type)
jjbayer 0c6c629
ref: Custom serializer for EmitOutcomes
jjbayer 1576c29
feat: Allow dynamic sampling config to propagate to external relays
jjbayer d534c1c
test: Fix integration test
jjbayer 26767f2
fix: tests and clippy
jjbayer 8bf84d9
ref: Apply review feedback
jjbayer d602615
feat: Batch client reports before sending as envelopes
jjbayer a09c68a
feat: Complete Outcome::from_outcome_type
jjbayer c8e1792
fix: Use same interval for client report batch as for outcome aggregator
jjbayer 57401b4
Merge remote-tracking branch 'origin/master' into feat/outcomes-as-cl…
jjbayer 84be868
Add changelog
jjbayer d2a9f19
Apply review feedback
jjbayer b13d136
Merge remote-tracking branch 'origin/master' into feat/outcomes-as-cl…
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use std::fmt; | ||
use std::{convert::TryFrom, fmt}; | ||
|
||
use globset::GlobBuilder; | ||
use regex::bytes::{Regex, RegexBuilder}; | ||
|
@@ -162,6 +162,26 @@ impl fmt::Display for FilterStatKey { | |
} | ||
} | ||
|
||
impl<'a> TryFrom<&'a str> for FilterStatKey { | ||
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. Don't we have a macro for this? maybe just for serde impl |
||
type Error = &'a str; | ||
|
||
fn try_from(value: &'a str) -> Result<Self, Self::Error> { | ||
Ok(match value { | ||
"ip-address" => FilterStatKey::IpAddress, | ||
"release-version" => FilterStatKey::ReleaseVersion, | ||
"error-message" => FilterStatKey::ErrorMessage, | ||
"browser-extensions" => FilterStatKey::BrowserExtensions, | ||
"legacy-browsers" => FilterStatKey::LegacyBrowsers, | ||
"localhost" => FilterStatKey::Localhost, | ||
"web-crawlers" => FilterStatKey::WebCrawlers, | ||
"invalid-csp" => FilterStatKey::InvalidCsp, | ||
other => { | ||
return Err(other); | ||
} | ||
}) | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
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
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.
@jjbayer this makes me think, maybe we should make the field in the config
Option<EmitOutcomes>
so explicitly setting the value to anything takes precedence over this. but not entirely sure. can leave it out for now