ref(processing): Use new transactions processor#5379
Conversation
…use-new-processor
| # Ignore span metrics, they may be emitted because rate limits from transactions are not | ||
| # currently enforced for spans, which they should be. See: https://github.com/getsentry/relay/issues/4961. | ||
| metrics = {metric["name"] for (metric, _) in metrics_consumer.get_metrics()} | ||
| assert metrics == { | ||
| "c:spans/count_per_root_project@none", | ||
| "c:spans/usage@none", | ||
| } | ||
|
|
| config["transactionMetrics"] = { | ||
| "version": TRANSACTION_EXTRACT_MIN_SUPPORTED_VERSION - 1, | ||
| } |
There was a problem hiding this comment.
This is necessary because I added a valid version to the default project config.
| if event_id: | ||
| envelope.headers["event_id"] = event_id |
There was a problem hiding this comment.
This test previously only passed because the metrics extraction version was too low. I.e. it used the wrong event ID for dynamic sampling (the auto-generated one from the envelope header), but the test does not check why so it passed anyway.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| process::run_dynamic_sampling(&work, ctx, filters_status, quotas_client).await; | ||
|
|
||
| relay_log::trace!("Sample transaction"); | ||
| let headers = work.headers.clone(); |
There was a problem hiding this comment.
I think you could also return the headers from SamplingOutput::Drop?
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
|
|
||
| if work.flags.spans_killswitched { | ||
| r.lenient(DataCategory::Span); | ||
| } |
There was a problem hiding this comment.
Missing SpanIndexed lenient marking when spans killswitched
Medium Severity
When spans_killswitched is true, split_indexed_and_total only marks DataCategory::Span as lenient, but not DataCategory::SpanIndexed. This is inconsistent with extract_spans which marks both categories as lenient. Since split_indexed_and_total can be called via the dynamic sampling "drop" path in non-processing relays (where extract_spans doesn't run), the ExpandedTransaction<Indexed> will still count embedded spans as SpanIndexed without the category being marked lenient, causing incorrect accounting.
Additional Locations (1)
84782e4 to
34eec75
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Closes INGEST-610.