sentry icon indicating copy to clipboard operation
sentry copied to clipboard

ref(grouping): Attach variants to event object during ingest

Open lobsterkatie opened this issue 1 year ago • 1 comments

In order to avoid running the grouping calculation more than once during ingest, this attaches the list of variants to the event object after they're calculated. Because the variants are attached at the object's top level (and not in its data), we can add them without worrying about them getting stored in in the database- the data passed to store comes from the event manager, which in turn takes its data from event.data.data in save_error_events. In other words, nothing at the top level is preserved.

lobsterkatie avatar Oct 03 '24 22:10 lobsterkatie

:x: 23 Tests Failed:

Tests completed Failed Passed Skipped
21729 23 21706 214
View the top 3 failed tests by shortest run time
tests.sentry.grouping.ingest.test_seer.ShouldCallSeerTest test_obeys_customized_fingerprint_check
Stack Traces | 3.64s run time
#x1B[1m#x1B[.../grouping/ingest/test_seer.py#x1B[0m:160: in test_obeys_customized_fingerprint_check
    assert (
#x1B[1m#x1B[.../grouping/ingest/seer.py#x1B[0m:45: in should_call_seer_for_grouping
    _has_customized_fingerprint(event)
#x1B[1m#x1B[.../grouping/ingest/seer.py#x1B[0m:100: in _has_customized_fingerprint
    variants = event.variants
#x1B[1m#x1B[31mE   AttributeError: 'Event' object has no attribute 'variants'#x1B[0m
tests.sentry.event_manager.grouping.test_assign_to_group test_new_group[ in_transition: True ]
Stack Traces | 4.44s run time
#x1B[1m#x1B[.../event_manager/grouping/test_assign_to_group.py#x1B[0m:260: in test_new_group
    results = get_results_from_saving_event(
#x1B[1m#x1B[.../event_manager/grouping/test_assign_to_group.py#x1B[0m:201: in get_results_from_saving_event
    secondary_hash = return_values["_calculate_secondary_hashes"][0][0]
#x1B[1m#x1B[31mE   IndexError: list index out of range#x1B[0m
tests.sentry.digests.backends.test_redis.RedisBackendTestCase test_missing_record_contents
Stack Traces | 4.47s run time
#x1B[1m#x1B[.../digests/backends/test_redis.py#x1B[0m:140: in test_missing_record_contents
    backend.add("timeline", record_1)
#x1B[1m#x1B[.../digests/backends/redis.py#x1B[0m:135: in add
    self.codec.encode(record.value),
#x1B[1m#x1B[.../sentry/digests/codecs.py#x1B[0m:16: in encode
    return zlib.compress(pickle.dumps(value))
#x1B[1m#x1B[31mE   AttributeError: Can't get local object 'create_strategy_configuration.<locals>.NewStrategyConfiguration'#x1B[0m

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

codecov[bot] avatar Oct 03 '24 22:10 codecov[bot]

Welp - that didn't work. Closing this in favor of a different approach (see https://github.com/getsentry/sentry/pull/78630).

lobsterkatie avatar Oct 04 '24 18:10 lobsterkatie