Skip to content

Commit 6c19c53

Browse files
authored
feat(spans): Add downsampled_retention_days and sample rates to items (#97790)
These fields were added to Relay already. getsentry/relay#5059
1 parent 56def5b commit 6c19c53

File tree

12 files changed

+146
-84
lines changed

12 files changed

+146
-84
lines changed

devservices/config.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,6 @@ x-sentry-service-config:
143143
post-process-forwarder-issue-platform:
144144
description: Post-process forwarder for issue platform events
145145
# Subscription results consumers
146-
eap-spans-subscription-results:
147-
description: Kafka consumer for processing subscription results for spans
148146
subscription-results-eap-items:
149147
description: Kafka consumer for processing subscription results for eap items
150148
metrics-subscription-results:
@@ -184,7 +182,6 @@ x-sentry-service-config:
184182
post-process-forwarder-errors,
185183
post-process-forwarder-transactions,
186184
post-process-forwarder-issue-platform,
187-
eap-spans-subscription-results,
188185
subscription-results-eap-items,
189186
metrics-subscription-results,
190187
generic-metrics-subscription-results,
@@ -339,8 +336,6 @@ x-programs:
339336
command: sentry run consumer post-process-forwarder-issue-platform --consumer-group=sentry-consumer --auto-offset-reset=latest --no-strict-offset-reset
340337
ingest-feedback-events:
341338
command: sentry run consumer ingest-feedback-events --consumer-group=sentry-consumer --auto-offset-reset=latest --no-strict-offset-reset
342-
eap-spans-subscription-results:
343-
command: sentry run consumer eap-spans-subscription-results --consumer-group=sentry-consumer --auto-offset-reset=latest --no-strict-offset-reset
344339
subscription-results-eap-items:
345340
command: sentry run consumer subscription-results-eap-items --consumer-group=sentry-consumer --auto-offset-reset=latest --no-strict-offset-reset
346341
metrics-subscription-results:

pyproject.toml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ dependencies = [
7878
# [end] jsonschema format validators
7979
"sentry-arroyo>=2.29.0",
8080
"sentry-forked-email-reply-parser>=0.5.12.post1",
81-
"sentry-kafka-schemas>=1.3.18",
81+
"sentry-kafka-schemas>=2.1.0",
8282
"sentry-ophio>=1.1.3",
83-
"sentry-protos>=0.3.1",
83+
"sentry-protos>=0.3.4",
8484
"sentry-redis-tools>=0.5.0",
8585
"sentry-relay>=0.9.11",
8686
"sentry-sdk[http2]>=2.29.1",
@@ -212,36 +212,36 @@ addopts = "--tb=short -p no:celery --nomigrations"
212212
# TODO: --import-mode=importlib will become the default soon,
213213
# currently we have a few relative imports that don't work with that.
214214
markers = [
215-
"snuba: test requires access to snuba",
216-
"snuba_ci: test is run in snuba ci",
217-
"sentry_metrics: test requires access to sentry metrics",
218-
"symbolicator: test requires access to symbolicator",
219-
"querybuilder: smoke tests for QueryBuilders",
220-
"thread_leak_allowlist: temporarily allow known-issue thread leaks",
215+
"snuba: test requires access to snuba",
216+
"snuba_ci: test is run in snuba ci",
217+
"sentry_metrics: test requires access to sentry metrics",
218+
"symbolicator: test requires access to symbolicator",
219+
"querybuilder: smoke tests for QueryBuilders",
220+
"thread_leak_allowlist: temporarily allow known-issue thread leaks",
221221
]
222222
filterwarnings = [
223-
# Consider all warnings to be errors other than the ignored ones.
224-
"error",
223+
# Consider all warnings to be errors other than the ignored ones.
224+
"error",
225225

226-
# TODO: we should fix these, but for now there's a lot
227-
"ignore:datetime.datetime.utcfromtimestamp\\(\\) is deprecated.*",
228-
"ignore:datetime.datetime.utcnow\\(\\) is deprecated.*",
226+
# TODO: we should fix these, but for now there's a lot
227+
"ignore:datetime.datetime.utcfromtimestamp\\(\\) is deprecated.*",
228+
"ignore:datetime.datetime.utcnow\\(\\) is deprecated.*",
229229

230-
# The following warning filters are for pytest only.
231-
"ignore:.*sentry.digests.backends.dummy.DummyBackend.*:sentry.utils.warnings.UnsupportedBackend",
230+
# The following warning filters are for pytest only.
231+
"ignore:.*sentry.digests.backends.dummy.DummyBackend.*:sentry.utils.warnings.UnsupportedBackend",
232232

233-
# pytest has not yet implemented the replacement for this yet
234-
"ignore:The --looponfail command line argument.*",
233+
# pytest has not yet implemented the replacement for this yet
234+
"ignore:The --looponfail command line argument.*",
235235
]
236236
looponfailroots = ["src", "tests"]
237237

238238
[tool.mypy]
239239
python_version = "3.13"
240240
mypy_path = ["fixtures/stubs-for-mypy"]
241241
plugins = [
242-
"pydantic.mypy",
243-
"mypy_django_plugin.main",
244-
"tools.mypy_helpers.plugin",
242+
"pydantic.mypy",
243+
"mypy_django_plugin.main",
244+
"tools.mypy_helpers.plugin",
245245
]
246246
files = ["."]
247247
exclude = ["^.venv/", "^venv/", "^self-hosted/"]
@@ -254,16 +254,16 @@ warn_unused_configs = true
254254
warn_unused_ignores = true
255255
warn_redundant_casts = true
256256
enable_error_code = ["ignore-without-code", "redundant-self"]
257-
local_partial_types = true # compat with dmypy
257+
local_partial_types = true # compat with dmypy
258258

259259
[tool.django-stubs]
260260
django_settings_module = "sentry.conf.server_mypy"
261261

262262
# these have py.typed but incorrect types
263263
[[tool.mypy.overrides]]
264264
module = [
265-
# TODO: these cause type errors when followed
266-
"snuba_sdk.*",
265+
# TODO: these cause type errors when followed
266+
"snuba_sdk.*",
267267
]
268268
follow_imports = "skip"
269269

src/sentry/conf/server.py

Lines changed: 84 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -900,12 +900,24 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
900900

901901

902902
CELERY_QUEUES_CONTROL = [
903-
Queue("app_platform.control", routing_key="app_platform.control", exchange=control_exchange),
903+
Queue(
904+
"app_platform.control",
905+
routing_key="app_platform.control",
906+
exchange=control_exchange,
907+
),
904908
Queue("auth.control", routing_key="auth.control", exchange=control_exchange),
905909
Queue("cleanup.control", routing_key="cleanup.control", exchange=control_exchange),
906910
Queue("email.control", routing_key="email.control", exchange=control_exchange),
907-
Queue("integrations.control", routing_key="integrations.control", exchange=control_exchange),
908-
Queue("files.delete.control", routing_key="files.delete.control", exchange=control_exchange),
911+
Queue(
912+
"integrations.control",
913+
routing_key="integrations.control",
914+
exchange=control_exchange,
915+
),
916+
Queue(
917+
"files.delete.control",
918+
routing_key="files.delete.control",
919+
exchange=control_exchange,
920+
),
909921
Queue(
910922
"hybrid_cloud.control_repair",
911923
routing_key="hybrid_cloud.control_repair",
@@ -914,7 +926,11 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
914926
Queue("options.control", routing_key="options.control", exchange=control_exchange),
915927
Queue("outbox.control", routing_key="outbox.control", exchange=control_exchange),
916928
Queue("webhook.control", routing_key="webhook.control", exchange=control_exchange),
917-
Queue("relocation.control", routing_key="relocation.control", exchange=control_exchange),
929+
Queue(
930+
"relocation.control",
931+
routing_key="relocation.control",
932+
exchange=control_exchange,
933+
),
918934
Queue(
919935
"release_registry.control",
920936
routing_key="release_registry.control",
@@ -943,7 +959,8 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
943959
Queue("default", routing_key="default"),
944960
Queue("delayed_rules", routing_key="delayed_rules"),
945961
Queue(
946-
"delete_seer_grouping_records_by_hash", routing_key="delete_seer_grouping_records_by_hash"
962+
"delete_seer_grouping_records_by_hash",
963+
routing_key="delete_seer_grouping_records_by_hash",
947964
),
948965
Queue("digests.delivery", routing_key="digests.delivery"),
949966
Queue("digests.scheduling", routing_key="digests.scheduling"),
@@ -952,11 +969,16 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
952969
Queue("events.preprocess_event", routing_key="events.preprocess_event"),
953970
Queue("events.process_event", routing_key="events.process_event"),
954971
Queue(
955-
"events.reprocessing.preprocess_event", routing_key="events.reprocessing.preprocess_event"
972+
"events.reprocessing.preprocess_event",
973+
routing_key="events.reprocessing.preprocess_event",
956974
),
957-
Queue("events.reprocessing.process_event", routing_key="events.reprocessing.process_event"),
958975
Queue(
959-
"events.reprocessing.symbolicate_event", routing_key="events.reprocessing.symbolicate_event"
976+
"events.reprocessing.process_event",
977+
routing_key="events.reprocessing.process_event",
978+
),
979+
Queue(
980+
"events.reprocessing.symbolicate_event",
981+
routing_key="events.reprocessing.symbolicate_event",
960982
),
961983
Queue("events.save_event", routing_key="events.save_event"),
962984
Queue("events.save_event_highcpu", routing_key="events.save_event_highcpu"),
@@ -969,9 +991,13 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
969991
Queue("files.copy", routing_key="files.copy"),
970992
Queue("files.delete", routing_key="files.delete"),
971993
Queue(
972-
"group_owners.process_suspect_commits", routing_key="group_owners.process_suspect_commits"
994+
"group_owners.process_suspect_commits",
995+
routing_key="group_owners.process_suspect_commits",
996+
),
997+
Queue(
998+
"group_owners.process_commit_context",
999+
routing_key="group_owners.process_commit_context",
9731000
),
974-
Queue("group_owners.process_commit_context", routing_key="group_owners.process_commit_context"),
9751001
Queue("integrations", routing_key="integrations"),
9761002
Queue(
9771003
"releasemonitor",
@@ -1016,18 +1042,27 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
10161042
Queue("auto_enable_codecov", routing_key="auto_enable_codecov"),
10171043
Queue("weekly_escalating_forecast", routing_key="weekly_escalating_forecast"),
10181044
Queue("relocation", routing_key="relocation"),
1019-
Queue("performance.statistical_detector", routing_key="performance.statistical_detector"),
1045+
Queue(
1046+
"performance.statistical_detector",
1047+
routing_key="performance.statistical_detector",
1048+
),
10201049
Queue("profiling.statistical_detector", routing_key="profiling.statistical_detector"),
10211050
CELERY_ISSUE_STATES_QUEUE,
10221051
Queue("nudge.invite_missing_org_members", routing_key="invite_missing_org_members"),
10231052
Queue("auto_resolve_issues", routing_key="auto_resolve_issues"),
10241053
Queue("on_demand_metrics", routing_key="on_demand_metrics"),
10251054
Queue("check_new_issue_threshold_met", routing_key="check_new_issue_threshold_met"),
1026-
Queue("integrations_slack_activity_notify", routing_key="integrations_slack_activity_notify"),
1055+
Queue(
1056+
"integrations_slack_activity_notify",
1057+
routing_key="integrations_slack_activity_notify",
1058+
),
10271059
Queue("demo_mode", routing_key="demo_mode"),
10281060
Queue("release_registry", routing_key="release_registry"),
10291061
Queue("seer.seer_automation", routing_key="seer.seer_automation"),
1030-
Queue("workflow_engine.process_workflows", routing_key="workflow_engine.process_workflows"),
1062+
Queue(
1063+
"workflow_engine.process_workflows",
1064+
routing_key="workflow_engine.process_workflows",
1065+
),
10311066
Queue("workflow_engine.trigger_action", routing_key="workflow_engine.trigger_action"),
10321067
]
10331068

@@ -1400,7 +1435,10 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
14001435
}
14011436

14021437
BGTASKS: dict[str, BgTaskConfig] = {
1403-
"sentry.bgtasks.clean_dsymcache:clean_dsymcache": {"interval": 5 * 60, "roles": ["worker"]},
1438+
"sentry.bgtasks.clean_dsymcache:clean_dsymcache": {
1439+
"interval": 5 * 60,
1440+
"roles": ["worker"],
1441+
},
14041442
}
14051443

14061444
#######################
@@ -1757,7 +1795,10 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
17571795
elif SILO_MODE == "REGION":
17581796
TASKWORKER_SCHEDULES = TASKWORKER_REGION_SCHEDULES
17591797
else:
1760-
TASKWORKER_SCHEDULES = {**TASKWORKER_CONTROL_SCHEDULES, **TASKWORKER_REGION_SCHEDULES}
1798+
TASKWORKER_SCHEDULES = {
1799+
**TASKWORKER_CONTROL_SCHEDULES,
1800+
**TASKWORKER_REGION_SCHEDULES,
1801+
}
17611802

17621803
TASKWORKER_HIGH_THROUGHPUT_NAMESPACES = {
17631804
"ingest.profiling",
@@ -1783,7 +1824,10 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
17831824
# This `internal` logger is separate from the `Logging` integration in the SDK. Since
17841825
# we have this to record events, in `sdk.py` we set the integration's `event_level` to
17851826
# None, so that it records breadcrumbs for all log calls but doesn't send any events.
1786-
"internal": {"level": "ERROR", "class": "sentry_sdk.integrations.logging.EventHandler"},
1827+
"internal": {
1828+
"level": "ERROR",
1829+
"class": "sentry_sdk.integrations.logging.EventHandler",
1830+
},
17871831
"metrics": {
17881832
"level": "WARNING",
17891833
"filters": ["important_django_request"],
@@ -1816,7 +1860,11 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
18161860
# This only needs to go to Sentry for now.
18171861
"sentry.similarity": {"handlers": ["internal"], "propagate": False},
18181862
"sentry.errors": {"handlers": ["console"], "propagate": False},
1819-
"sentry_sdk.errors": {"handlers": ["console"], "level": "INFO", "propagate": False},
1863+
"sentry_sdk.errors": {
1864+
"handlers": ["console"],
1865+
"level": "INFO",
1866+
"propagate": False,
1867+
},
18201868
"sentry.rules": {"handlers": ["console"], "propagate": False},
18211869
"sentry.profiles": {"level": "INFO"},
18221870
"multiprocessing": {
@@ -1836,7 +1884,11 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
18361884
"propagate": False,
18371885
},
18381886
"toronado": {"level": "ERROR", "handlers": ["null"], "propagate": False},
1839-
"urllib3.connectionpool": {"level": "ERROR", "handlers": ["console"], "propagate": False},
1887+
"urllib3.connectionpool": {
1888+
"level": "ERROR",
1889+
"handlers": ["console"],
1890+
"propagate": False,
1891+
},
18401892
"boto3": {"level": "WARNING", "handlers": ["console"], "propagate": False},
18411893
"botocore": {"level": "WARNING", "handlers": ["console"], "propagate": False},
18421894
},
@@ -1887,7 +1939,10 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:
18871939
# We override the default behavior to skip adding the choice name to the bullet point if
18881940
# it's identical to the choice value by monkey patching build_choice_description_list.
18891941
"ENUM_GENERATE_CHOICE_DESCRIPTION": True,
1890-
"LICENSE": {"name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html"},
1942+
"LICENSE": {
1943+
"name": "Apache 2.0",
1944+
"url": "http://www.apache.org/licenses/LICENSE-2.0.html",
1945+
},
18911946
"PARSER_WHITELIST": ["rest_framework.parsers.JSONParser"],
18921947
"POSTPROCESSING_HOOKS": [
18931948
"sentry.apidocs.hooks.custom_postprocessing_hook",
@@ -2371,7 +2426,12 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:
23712426
("org:write", "Read and write access to organization details."),
23722427
("org:read", "Read access to organization details."),
23732428
),
2374-
(("org:integrations", "Read, write, and admin access to organization integrations."),),
2429+
(
2430+
(
2431+
"org:integrations",
2432+
"Read, write, and admin access to organization integrations.",
2433+
),
2434+
),
23752435
(
23762436
("member:admin", "Read, write, and admin access to organization members."),
23772437
("member:write", "Read and write access to organization members."),
@@ -2737,7 +2797,10 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:
27372797
{
27382798
"image": f"ghcr.io/getsentry/image-mirror-library-postgres:{PG_VERSION}-alpine",
27392799
"ports": {"5432/tcp": 5432},
2740-
"environment": {"POSTGRES_DB": "sentry", "POSTGRES_HOST_AUTH_METHOD": "trust"},
2800+
"environment": {
2801+
"POSTGRES_DB": "sentry",
2802+
"POSTGRES_HOST_AUTH_METHOD": "trust",
2803+
},
27412804
"volumes": {
27422805
"postgres": {"bind": "/var/lib/postgresql/data"},
27432806
"wal2json": {"bind": "/wal2json"},
@@ -3373,7 +3436,6 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:
33733436
"transactions-subscription-results": "default",
33743437
"generic-metrics-subscription-results": "default",
33753438
"metrics-subscription-results": "default",
3376-
"eap-spans-subscription-results": "default",
33773439
"subscription-results-eap-items": "default",
33783440
"ingest-events": "default",
33793441
"ingest-feedback-events": "default",
@@ -3407,12 +3469,10 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:
34073469
"generic-events": "default",
34083470
"snuba-generic-events-commit-log": "default",
34093471
"group-attributes": "default",
3410-
"snuba-spans": "default",
34113472
"snuba-items": "default",
34123473
"shared-resources-usage": "default",
34133474
"buffered-segments": "default",
34143475
"buffered-segments-dlq": "default",
3415-
"snuba-ourlogs": "default",
34163476
"preprod-artifact-events": "default",
34173477
# Taskworker topics
34183478
"taskworker": "default",

src/sentry/conf/types/kafka_definition.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ class Topic(Enum):
2727
TRANSACTIONS_SUBSCRIPTIONS_RESULTS = "transactions-subscription-results"
2828
GENERIC_METRICS_SUBSCRIPTIONS_RESULTS = "generic-metrics-subscription-results"
2929
METRICS_SUBSCRIPTIONS_RESULTS = "metrics-subscription-results"
30-
EAP_SPANS_SUBSCRIPTIONS_RESULTS = "eap-spans-subscription-results"
31-
EAP_ITEMS_SUBSCRIPTIONS_RESULTS = "subscription-results-eap-items"
3230
INGEST_EVENTS = "ingest-events"
3331
INGEST_EVENTS_DLQ = "ingest-events-dlq"
3432
INGEST_EVENTS_BACKLOG = "ingest-events-backlog"
@@ -65,9 +63,8 @@ class Topic(Enum):
6563
GENERIC_EVENTS_COMMIT_LOG = "snuba-generic-events-commit-log"
6664
GROUP_ATTRIBUTES = "group-attributes"
6765
SHARED_RESOURCES_USAGE = "shared-resources-usage"
68-
SNUBA_SPANS = "snuba-spans"
69-
SNUBA_OURLOGS = "snuba-ourlogs"
7066
SNUBA_ITEMS = "snuba-items"
67+
EAP_ITEMS_SUBSCRIPTIONS_RESULTS = "subscription-results-eap-items"
7168
BUFFERED_SEGMENTS = "buffered-segments"
7269
BUFFERED_SEGMENTS_DLQ = "buffered-segments-dlq"
7370

@@ -114,7 +111,6 @@ class Topic(Enum):
114111

115112

116113
class ConsumerDefinition(TypedDict, total=False):
117-
118114
# Default topic
119115
topic: Required[Topic]
120116

0 commit comments

Comments
 (0)