Skip to content

Commit 94cb750

Browse files
ref: Remove organizations:event-preprocessors-without-plugins feature flag
The flag gating direct event preprocessing (bypassing plugin infra for Java/JavaScript/Dart) is fully rolled out. Remove the flag and keep only the new code path that calls get_event_preprocessors() directly. - Remove flag check branching in should_process() and do_process_event() - Delete deprecated JavaPlugin, JavascriptPlugin, DartPlugin classes - Remove lang app configs from INSTALLED_APPS (no models/migrations) - Delete associated plugin test files (logic covered by test_event_preprocessors.py) - Update plugin registry test and JS test import
1 parent 7c8f460 commit 94cb750

15 files changed

Lines changed: 12 additions & 596 deletions

File tree

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,9 +1023,7 @@ module = [
10231023
"sentry.lang",
10241024
"sentry.lang.dart.*",
10251025
"sentry.lang.java",
1026-
"sentry.lang.java.apps",
10271026
"sentry.lang.java.exceptions",
1028-
"sentry.lang.java.plugin",
10291027
"sentry.lang.java.proguard",
10301028
"sentry.lang.java.utils",
10311029
"sentry.lang.java.view_hierarchies",

src/sentry/conf/server.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,6 @@ def env(
482482
"sentry.sentry_metrics",
483483
"sentry.sentry_metrics.indexer.postgres.apps.Config",
484484
"sentry.snuba",
485-
"sentry.lang.java.apps.Config",
486-
"sentry.lang.javascript.apps.Config",
487-
"sentry.lang.dart.apps.Config",
488485
"sentry.plugins.sentry_interface_types.apps.Config",
489486
"sentry.plugins.sentry_urls.apps.Config",
490487
"sentry.plugins.sentry_useragents.apps.Config",

src/sentry/features/temporary.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ def register_temporary_features(manager: FeatureManager) -> None:
8585
manager.add("organizations:intercom-support", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
8686
# Enable default anomaly detection metric monitor for new projects
8787
manager.add("organizations:default-anomaly-detector", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
88-
# Don't use plugin infra for language plugins/preprocessor logic
89-
manager.add("organizations:event-preprocessors-without-plugins", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False)
9088
# Enable the discover saved queries deprecation warnings
9189
manager.add("organizations:discover-saved-queries-deprecation", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
9290
# Enable migration of transaction widgets and queries to spans

src/sentry/lang/dart/apps.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/sentry/lang/dart/plugin.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/sentry/lang/java/apps.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/sentry/lang/java/plugin.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/sentry/lang/javascript/apps.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/sentry/lang/javascript/plugin.py

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/sentry/tasks/store.py

Lines changed: 11 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import sentry_sdk
1111
from sentry_relay.processing import StoreNormalizer
1212

13-
from sentry import features, options, reprocessing2
13+
from sentry import options, reprocessing2
1414
from sentry.attachments import delete_cached_and_ratelimited_attachments, get_attachments_for_event
1515
from sentry.constants import DEFAULT_STORE_NORMALIZER_ARGS
1616
from sentry.event_preprocessors import get_event_preprocessors
@@ -47,34 +47,19 @@ class RetryProcessing(Exception):
4747
pass
4848

4949

50-
LANGUAGE_PLUGIN_SLUGS = frozenset({"javaplugin", "javascriptplugin", "dartplugin"})
51-
52-
5350
def should_process(data: Mapping[str, Any]) -> bool:
5451
"""Quick check if processing is needed at all."""
5552
from sentry.plugins.base import plugins
5653

5754
if data.get("type") == "transaction":
5855
return False
5956

60-
project = Project.objects.get_from_cache(id=data["project"])
61-
project.set_cached_field_value(
62-
"organization", Organization.objects.get_from_cache(id=project.organization_id)
63-
)
64-
if features.has("organizations:event-preprocessors-without-plugins", project.organization):
65-
if get_event_preprocessors(data):
57+
if get_event_preprocessors(data):
58+
return True
59+
for plugin in plugins.all(version=2):
60+
processors = safe_execute(plugin.get_event_preprocessors, data=data)
61+
if processors:
6662
return True
67-
for plugin in plugins.all(version=2):
68-
if plugin.slug in LANGUAGE_PLUGIN_SLUGS:
69-
continue
70-
processors = safe_execute(plugin.get_event_preprocessors, data=data)
71-
if processors:
72-
return True
73-
else:
74-
for plugin in plugins.all(version=2):
75-
processors = safe_execute(plugin.get_event_preprocessors, data=data)
76-
if processors:
77-
return True
7863

7964
if should_process_for_stacktraces(data):
8065
return True
@@ -422,38 +407,17 @@ def _continue_to_save_event() -> None:
422407
data = new_data
423408

424409
# Default event processors.
425-
use_new_preprocessors = features.has(
426-
"organizations:event-preprocessors-without-plugins", project.organization
427-
)
428-
if use_new_preprocessors:
429-
preprocessors = get_event_preprocessors(data)
430-
for plugin in plugins.all(version=2):
431-
if plugin.slug in LANGUAGE_PLUGIN_SLUGS:
432-
continue
433-
preprocessors.extend(safe_execute(plugin.get_event_preprocessors, data=data) or ())
434-
else:
435-
preprocessors = []
436-
for plugin in plugins.all(version=2):
437-
preprocessors.extend(safe_execute(plugin.get_event_preprocessors, data=data) or ())
438-
439-
preprocessor_span_op = (
440-
"task.store.process_event.new_preprocessors"
441-
if use_new_preprocessors
442-
else "task.store.process_event.preprocessors"
443-
)
444-
preprocessor_log_msg = (
445-
"tasks.store.new_preprocessors.error"
446-
if use_new_preprocessors
447-
else "tasks.store.preprocessors.error"
448-
)
410+
preprocessors = get_event_preprocessors(data)
411+
for plugin in plugins.all(version=2):
412+
preprocessors.extend(safe_execute(plugin.get_event_preprocessors, data=data) or ())
449413

450-
with sentry_sdk.start_span(op=preprocessor_span_op) as span:
414+
with sentry_sdk.start_span(op="task.store.process_event.preprocessors") as span:
451415
span.set_data("from_symbolicate", from_symbolicate)
452416
for processor in preprocessors:
453417
try:
454418
result = processor(data)
455419
except Exception:
456-
error_logger.exception(preprocessor_log_msg)
420+
error_logger.exception("tasks.store.preprocessors.error")
457421
data.setdefault("_metrics", {})["flag.processing.error"] = True
458422
has_changed = True
459423
else:

0 commit comments

Comments
 (0)