Skip to content

Commit

Permalink
ref(spans): Split off span description scrubbing into separate file (#…
Browse files Browse the repository at this point in the history
…2303)

Move all span description scrubbing logic into a separate file. This
should make it easier to contribute, and prepares for the next step:
Moving span tagging from metrics extraction to normalization.

Changes in `relay-general/src/store/`:

```
transactions/processor.rs -> normalize/span/description.rs  (only span-specific parts)
normalize/spans.rs        -> normalize/span/attributes.rs
```

This PR contains no functional changes.
  • Loading branch information
jjbayer committed Jul 13, 2023
1 parent 0002cff commit 11532f1
Show file tree
Hide file tree
Showing 7 changed files with 622 additions and 618 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Rust
**/*.rs.bk
target
*.pending-snap

# Python
.venv/
Expand Down
13 changes: 8 additions & 5 deletions relay-general/src/store/normalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ use crate::types::{
use crate::user_agent::RawUserAgentInfo;

pub mod breakdowns;
pub mod span;
pub mod user_agent;

mod contexts;
mod logentry;
mod mechanism;
mod request;
mod spans;
mod stacktrace;

pub mod user_agent;

/// Defines a builtin measurement.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
Expand Down Expand Up @@ -198,7 +198,7 @@ impl<'a> NormalizeProcessor<'a> {

fn normalize_spans(&self, event: &mut Event) {
if event.ty.value() == Some(&EventType::Transaction) {
spans::normalize_spans(event, &self.config.span_attributes);
span::attributes::normalize_spans(event, &self.config.span_attributes);
}
}

Expand Down Expand Up @@ -841,7 +841,10 @@ pub fn light_normalize_event(
// transactions don't have many spans, but if this is no longer the
// case and we roll this flag out for most projects, we may want to
// reconsider this approach.
spans::normalize_spans(event, &BTreeSet::from([SpanAttribute::ExclusiveTime]));
span::attributes::normalize_spans(
event,
&BTreeSet::from([SpanAttribute::ExclusiveTime]),
);
}

Ok(())
Expand Down
File renamed without changes.
Loading

0 comments on commit 11532f1

Please sign in to comment.