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

feat(replays): Use user configured PII scrubbers #1731

Merged
merged 4 commits into from
Feb 3, 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 @@
**Features**:

- Add support for client hints. ([#1752](https://github.com/getsentry/relay/pull/1752))
- Apply all configured data scrubbing rules on Replays. ([#1731](https://github.com/getsentry/relay/pull/1731))
- Add count transactions toward root project. ([#1734](https://github.com/getsentry/relay/pull/1734))

**Bug Fixes**:
Expand Down
14 changes: 12 additions & 2 deletions relay-replays/benches/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ use std::io::Read;

use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
use flate2::{bufread::ZlibEncoder, Compression};
use relay_replays::recording::transcode_replay;

use relay_general::pii::DataScrubbingConfig;
use relay_replays::recording::ReplayScrubber;

fn bench_recording(c: &mut Criterion) {
let payload = include_bytes!("../tests/fixtures/rrweb.json");
Expand All @@ -13,10 +15,18 @@ fn bench_recording(c: &mut Criterion) {
let mut encoder = ZlibEncoder::new(payload.as_slice(), Compression::default());
encoder.read_to_end(&mut compressed).unwrap();

let mut scrubbing_config = DataScrubbingConfig::default();
scrubbing_config.scrub_data = true;
scrubbing_config.scrub_defaults = true;
scrubbing_config.scrub_ip_addresses = true;
let pii_config = scrubbing_config.pii_config_uncached().unwrap().unwrap();

let mut scrubber = ReplayScrubber::new(usize::MAX, Some(&pii_config), None);

c.bench_with_input(BenchmarkId::new("rrweb", 1), &compressed, |b, &_| {
b.iter(|| {
let mut buf = Vec::new();
transcode_replay(criterion::black_box(&compressed), usize::MAX, &mut buf).ok();
scrubber.transcode_replay(&compressed, &mut buf).ok();
buf
});
});
Expand Down
Loading