Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9fd743a
ref(processing): Use new transactions processor
jjbayer Nov 14, 2025
4fd0055
fixes
jjbayer Nov 17, 2025
cea5ff1
refactor profile test
jjbayer Nov 17, 2025
989b031
ref
jjbayer Nov 17, 2025
b962ef8
Log error on extraction failure
jjbayer Nov 18, 2025
f063ad6
bookkeeping in metrics extraction
jjbayer Nov 18, 2025
add0dd8
fix except rate limiting
jjbayer Nov 18, 2025
40b1326
fix
jjbayer Nov 18, 2025
ce20017
split rate limiting code
jjbayer Nov 18, 2025
4ccc557
rust tests pass
jjbayer Nov 18, 2025
d8a903a
feat(spans): Add span_count item header
jjbayer Nov 18, 2025
4737ed3
Add TODO
jjbayer Nov 18, 2025
9c27ac4
ref: auto-ensure
jjbayer Nov 18, 2025
a1b42a2
simplify
jjbayer Nov 18, 2025
6f242b8
ensure
jjbayer Nov 18, 2025
fb2c132
ref
jjbayer Nov 18, 2025
799103e
test
jjbayer Nov 18, 2025
0ce93c7
rust test
jjbayer Nov 19, 2025
1ebc03f
fix integration test
jjbayer Nov 19, 2025
0120631
update test
jjbayer Nov 19, 2025
a2600b2
doc: changelog
jjbayer Nov 19, 2025
a9beb7c
review comments
jjbayer Nov 19, 2025
5acad09
test
jjbayer Nov 19, 2025
8031075
Merge branch 'feat/span-count' into ref/use-new-processor
jjbayer Nov 19, 2025
976c7cd
Count spans in item quantities
jjbayer Nov 19, 2025
886dbe7
instr: only measure actual parsing
jjbayer Nov 19, 2025
c095090
fix tests
jjbayer Nov 20, 2025
b1a4136
fix integration test
jjbayer Nov 20, 2025
a336c2c
Fix all the tests
jjbayer Nov 20, 2025
dd6e913
revert test fixture change
jjbayer Nov 20, 2025
c23617f
Merge branch 'feat/span-count' into ref/use-new-processor
jjbayer Nov 20, 2025
11861ed
test: update
jjbayer Nov 20, 2025
06410b2
lint
jjbayer Nov 20, 2025
6991a3a
test: more span outcomes
jjbayer Nov 20, 2025
27f059c
Merge branch 'feat/span-count' into ref/use-new-processor
jjbayer Nov 20, 2025
49d5fcb
Merge remote-tracking branch 'origin/master' into ref/use-new-processor
jjbayer Nov 20, 2025
753c2e9
fix: duplicate span counting
jjbayer Nov 20, 2025
0263642
fix test assumptions
jjbayer Nov 20, 2025
747a9a2
minor stuff
jjbayer Nov 20, 2025
6f1c486
fix bookkeeping
jjbayer Nov 20, 2025
e785f23
ref: transaction at the end
jjbayer Nov 20, 2025
cf08b4f
Update relay-server/src/processing/transactions/process.rs
jjbayer Nov 20, 2025
5256ccf
Update relay-server/src/processing/transactions/mod.rs
jjbayer Nov 20, 2025
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 @@ -11,6 +11,7 @@
**Internal**:

- Derive the rate limiting decision in Relay from consumed quota. ([#5390](https://github.com/getsentry/relay/pull/5390))
- Use new processor architecture to process transactions. ([#5379](https://github.com/getsentry/relay/pull/5379))

## 25.11.0

Expand Down
3 changes: 3 additions & 0 deletions relay-server/src/processing/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ use crate::processing::logs::LogsProcessor;
use crate::processing::sessions::SessionsProcessor;
use crate::processing::spans::SpansProcessor;
use crate::processing::trace_metrics::TraceMetricsProcessor;
use crate::processing::transactions::TransactionProcessor;
use crate::processing::{Forward, Processor};

macro_rules! outputs {
($($variant:ident => $ty:ty,)*) => {
/// All known [`Processor`] outputs.
#[derive(Debug)]
#[allow(clippy::large_enum_variant)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#[allow(clippy::large_enum_variant)]
#[expect(clippy::large_enum_variant), reason = "..."]

Alternatively we can also box the transaction output, I think that kinda depends why the lint triggers, if it's just because of a small-ish amount it's fine, if there is a large discrepancy maybe it's worth boxing.

pub enum Outputs {
$(
$variant(<$ty as Processor>::Output)
Expand Down Expand Up @@ -57,4 +59,5 @@ outputs!(
TraceMetrics => TraceMetricsProcessor,
Spans => SpansProcessor,
Sessions => SessionsProcessor,
Transactions => TransactionProcessor,
);
5 changes: 4 additions & 1 deletion relay-server/src/processing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ pub struct Context<'a> {
///
/// The caller needs to ensure the rate limits are not yet expired.
pub rate_limits: &'a RateLimits,
/// Reservoir counters for "get more samples" functionality.

/// Counters used for getting more samples for a project on-demand.
///
/// Reservoir counters are a legacy feature and will be removed in the near future.
pub reservoir_counters: &'a ReservoirCounters,
}

Expand Down
18 changes: 11 additions & 7 deletions relay-server/src/processing/transactions/extraction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,16 @@ pub fn extract_metrics(
metrics_extracted,
spans_extracted,
} = ctx;
// TODO(follow-up): this function should always extract metrics. Dynamic sampling should validate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanna link to a GH issue here?

// the full metrics extraction config and skip sampling if it is incomplete.

if metrics_extracted {
return Ok(EventMetricsExtracted(metrics_extracted));
debug_assert!(false, "metrics extraction called twice");
return Ok(EventMetricsExtracted(true));
}
let Some(event) = event.value_mut() else {
return Ok(EventMetricsExtracted(metrics_extracted));
// Nothing to extract, but metrics extraction was called.
return Ok(EventMetricsExtracted(true));
};

// NOTE: This function requires a `metric_extraction` in the project config. Legacy configs
Expand All @@ -71,7 +75,7 @@ pub fn extract_metrics(
let combined_config = {
let config = match &ctx.project_info.config.metric_extraction {
ErrorBoundary::Ok(config) if config.is_supported() => config,
_ => return Ok(EventMetricsExtracted(metrics_extracted)),
_ => return Ok(EventMetricsExtracted(false)),
};
let global_config = match &ctx.global_config.metric_extraction {
ErrorBoundary::Ok(global_config) => global_config,
Expand All @@ -86,7 +90,7 @@ pub fn extract_metrics(
// If there's an error with global metrics extraction, it is safe to assume that this
// Relay instance is not up-to-date, and we should skip extraction.
relay_log::debug!("Failed to parse global extraction config: {e}");
return Ok(EventMetricsExtracted(metrics_extracted));
return Ok(EventMetricsExtracted(false));
}
}
};
Expand All @@ -98,11 +102,11 @@ pub fn extract_metrics(
Some(ErrorBoundary::Ok(tx_config)) => tx_config,
Some(ErrorBoundary::Err(e)) => {
relay_log::debug!("Failed to parse legacy transaction metrics config: {e}");
return Ok(EventMetricsExtracted(metrics_extracted));
return Ok(EventMetricsExtracted(false));
}
None => {
relay_log::debug!("Legacy transaction metrics config is missing");
return Ok(EventMetricsExtracted(metrics_extracted));
return Ok(EventMetricsExtracted(false));
}
};

Expand All @@ -117,7 +121,7 @@ pub fn extract_metrics(
}
});

return Ok(EventMetricsExtracted(metrics_extracted));
return Ok(EventMetricsExtracted(false));
}

// If spans were already extracted for an event, we rely on span processing to extract metrics.
Expand Down
Loading
Loading