Skip to content

fix(eap): Add preprod item type to EAP items deletion config - #8232

Open
sentry[bot] wants to merge 1 commit into
masterfrom
claude/fix-preprod-deletion-config-fcffa8
Open

fix(eap): Add preprod item type to EAP items deletion config#8232
sentry[bot] wants to merge 1 commit into
masterfrom
claude/fix-preprod-deletion-config-fcffa8

Conversation

@sentry

@sentry sentry Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Add preprod to the allowed_attributes_by_item_type in the EAP items storage deletion settings, with sentry.trace_id as its allowed attribute.

Fixes SENTRY-5GX0

Problem

When deleting a preprod artifact, sentry calls Snuba's EndpointDeleteTraceItems RPC with TRACE_ITEM_TYPE_PREPROD (value: 11) and a filter on sentry.trace_id. Snuba returns a 500 error:

No attribute-based deletions configured for item_type preprod (value: 11). Configured item types: [occurrence]

The preprod item type was ingested into EAP but the corresponding deletion handler was never added to the storage configuration.

Fix

Add a preprod key to allowed_attributes_by_item_type in eap_items.yaml with sentry.trace_id as the allowed attribute, mirroring the existing occurrence entry. This allows the _validate_attribute_conditions function in bulk_delete_query.py to accept preprod deletion requests.

Before

allowed_attributes_by_item_type:
  occurrence:
    - group_id

After

allowed_attributes_by_item_type:
  occurrence:
    - group_id
  preprod:
    - sentry.trace_id

Validation

  • The sentry deletion code in preprod/helpers/deletion.py sends TRACE_ITEM_TYPE_PREPROD with sentry.trace_id as the attribute filter key — this matches the new config entry exactly.
  • The YAML schema (json_schema.py) defines allowed_attributes_by_item_type as an object with additionalProperties of array[string], so the new entry is schema-valid.
  • TRACE_ITEM_TYPE_PREPROD is already used elsewhere in snuba (routing strategies, querylog) confirming it's a recognized item type.

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/)
@sentry
sentry Bot requested review from a team as code owners July 27, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants