Skip to content
Draft
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
41 changes: 41 additions & 0 deletions tests/integration/test_spans.py
Original file line number Diff line number Diff line change
Expand Up @@ -1666,3 +1666,44 @@ def test_scrubs_ip_addresses(
assert parent_span["attributes"]["sentry.user.ip"]["value"] == "127.0.0.1"

spans_consumer.assert_empty()


def test_outcomes_for_trimmed_spans(mini_sentry, relay):
relay = relay(
mini_sentry,
options={
"limits": {"max_event_size": "20MB"},
},
)
project_id = 42
mini_sentry.add_full_project_config(project_id)

event = make_transaction({"event_id": "cbf6960622e14a45abc1f03b2055b186"})
end = datetime.now(timezone.utc) - timedelta(seconds=1)
duration = timedelta(milliseconds=500)
start = end - duration
event["spans"] = 10 * [
{
"platform": 1014 * 90 * "a",
"description": "GET /api/0/organizations/?member=1",
"op": "http",
"origin": "manual",
"parent_span_id": "968cff94913ebb07",
"span_id": "bbbbbbbbbbbbbbbb",
"start_timestamp": start.isoformat(),
"status": "success",
"tags": {
"extra_info": "added by user",
},
"sentry_tags": {
"release": 1024 * 100 * "b",
},
"timestamp": end.isoformat(),
"trace_id": "ff62a8b040f340bda5d830223def1d81",
},
]

relay.send_event(project_id, event)

outcomes = mini_sentry.get_outcomes(n=1)
assert outcomes == [1] # TODO: assert the outcomes we expect
Loading