fix(eap): Add preprod item type to EAP items deletion config - #8232
Open
sentry[bot] wants to merge 1 commit into
Open
fix(eap): Add preprod item type to EAP items deletion config#8232sentry[bot] wants to merge 1 commit into
sentry[bot] wants to merge 1 commit into
Conversation
Add 'preprod' to the allowed_attributes_by_item_type in the EAP items storage deletion settings, with 'sentry.trace_id' as its allowed attribute. This mirrors the existing 'occurrence' entry and enables Snuba's EndpointDeleteTraceItems RPC to handle deletion requests for the preprod trace item type. Without this, deleting a preprod artifact from sentry triggers a 500 from Snuba: 'No attribute-based deletions configured for item_type preprod (value: 11). Configured item types: [occurrence]' Fixes SENTRY-5GX0 (https://sentry.sentry.io/issues/7191210706/)
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.
Summary
Add
preprodto theallowed_attributes_by_item_typein the EAP items storage deletion settings, withsentry.trace_idas its allowed attribute.Fixes SENTRY-5GX0
Problem
When deleting a preprod artifact, sentry calls Snuba's
EndpointDeleteTraceItemsRPC withTRACE_ITEM_TYPE_PREPROD(value: 11) and a filter onsentry.trace_id. Snuba returns a 500 error:The preprod item type was ingested into EAP but the corresponding deletion handler was never added to the storage configuration.
Fix
Add a
preprodkey toallowed_attributes_by_item_typeineap_items.yamlwithsentry.trace_idas the allowed attribute, mirroring the existingoccurrenceentry. This allows the_validate_attribute_conditionsfunction inbulk_delete_query.pyto accept preprod deletion requests.Before
After
Validation
preprod/helpers/deletion.pysendsTRACE_ITEM_TYPE_PREPRODwithsentry.trace_idas the attribute filter key — this matches the new config entry exactly.json_schema.py) definesallowed_attributes_by_item_typeas an object withadditionalPropertiesofarray[string], so the new entry is schema-valid.TRACE_ITEM_TYPE_PREPRODis already used elsewhere in snuba (routing strategies, querylog) confirming it's a recognized item type.