fix(test): Use trusted Relay in trace metric test#5917
Open
loewenheim wants to merge 2 commits intomasterfrom
Open
fix(test): Use trusted Relay in trace metric test#5917loewenheim wants to merge 2 commits intomasterfrom
loewenheim wants to merge 2 commits intomasterfrom
Conversation
The size of a trace metric, which is relevant for billing, is supposed to be computed by the first trusted Relay in the chain and then not recomputed by subsequent Relays. This ensures that we only bill on data sent to us by the customer, not on normalizations we apply. Not using a trusted Relay in the test makes us recompute the size after normalization.
Dav1dde
approved these changes
Apr 30, 2026
Member
Dav1dde
left a comment
There was a problem hiding this comment.
I think it makes sense to look at the test_ourlog_extraction_with_sentry_logs and port over all the different modes.
@pytest.mark.parametrize(
"external_mode,expected_byte_size_1,expected_byte_size_2",
[
# The values here are billing relevant metrics, do not arbitrarily change it,
# these values are supposed to be static and purely based on data received,
# independent of any normalization.
(None, 18, 359),
# Same applies as above, a proxy Relay does not need to run normalization.
("proxy", 18, 359),
# If an external Relay/Client makes modifications, sizes can change,
# this is fuzzy due to slight changes in sizes due to added timestamps
# and may need to be adjusted when changing normalization.
("managed", 128, 459),
],
)Then again this is just a straight up improvement ✅
Contributor
Author
That's actually a good idea, I wasn't thinking that far. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The size of a trace metric, which is relevant for billing, is supposed to be computed by the first trusted Relay in the chain and then not recomputed by subsequent Relays. This ensures that we only bill on data sent to us by the customer, not on normalizations we apply.
This PR parametrizes the
test_trace_metric_extractiontest with different scenarios for external Relays to check that this works correctly for both trusted and untrusted Relays.