Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add EAP span subscriptions for devserver #6396

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ python-dateutil==2.8.2
python-rapidjson==1.8
redis==4.3.4
sentry-arroyo==2.17.6
sentry-kafka-schemas==0.1.112
sentry-kafka-schemas==0.1.113
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

includes this change getsentry/sentry-kafka-schemas#337

sentry-redis-tools==0.3.0
sentry-relay==0.8.44
sentry-sdk==1.40.5
Expand Down
4 changes: 2 additions & 2 deletions rust_snuba/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust_snuba/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pyo3 = { version = "0.18.1", features = ["chrono"] }
reqwest = { version = "0.11.11", features = ["stream"] }
rust_arroyo = { version = "*", git = "https://github.com/getsentry/arroyo" }
sentry = { version = "0.32.0", features = ["anyhow", "tracing"] }
sentry-kafka-schemas = "0.1.112"
sentry-kafka-schemas = "0.1.113"
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0" }
thiserror = "1.0"
Expand Down
40 changes: 40 additions & 0 deletions snuba/cli/devserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,30 @@ def devserver(*, bootstrap: bool, workers: bool) -> None:
"--auto-offset-reset=latest",
],
),
(
Copy link
Member

@untitaker untitaker Oct 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is an else-branch where you should add the same consumer again. normally in devserver, SEPARATE_SCHEDULER_EXECUTOR_SUBSCRIPTIONS_DEV is False, and subscription executor+scheduler are running in a single consumer (for lower resource usage)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added d803500

"subscriptions-scheduler-eap-spans",
[
"snuba",
"subscriptions-scheduler",
"--entity=eap_spans",
"--consumer-group=snuba-eap_spans-subscriptions-scheduler",
"--followed-consumer-group=eap_spans_group",
"--auto-offset-reset=latest",
"--log-level=debug",
"--schedule-ttl=10",
],
),
(
"subscriptions-executor-eap-spans",
[
"snuba",
"subscriptions-executor",
"--dataset=events_analytics_platform",
"--entity=eap_spans",
"--consumer-group=snuba-eap_spans-subscription-executor",
"--auto-offset-reset=latest",
],
),
]

else:
Expand Down Expand Up @@ -206,6 +230,22 @@ def devserver(*, bootstrap: bool, workers: bool) -> None:
"--stale-threshold-seconds=900",
],
),
(
"subscriptions-scheduler-executor-eap-spans",
[
"snuba",
"subscriptions-scheduler-executor",
"--dataset=events_analytics_platform",
"--entity=eap_spans",
"--consumer-group=snuba-eap_spans-subscription-executor",
"--followed-consumer-group=eap_spans_group",
"--auto-offset-reset=latest",
"--no-strict-offset-reset",
"--log-level=debug",
"--schedule-ttl=10",
"--stale-threshold-seconds=900",
],
),
]

if settings.ENABLE_SENTRY_METRICS_DEV:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,9 @@ mandatory_condition_checkers:
stream_loader:
processor: EAPSpansMessageProcessor
default_topic: snuba-spans
commit_log_topic: snuba-eap-spans-commit-log
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to call out that this topic doesn't exist in production (double/triple checking this is ok)

subscription_scheduler_mode: global
subscription_synchronization_timestamp: orig_message_ts
subscription_scheduled_topic: scheduled-subscriptions-eap-spans
subscription_result_topic: eap-spans-subscription-results
subscription_delay_seconds: 60
3 changes: 3 additions & 0 deletions snuba/utils/streams/topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ class Topic(Enum):
DEAD_LETTER_GROUP_ATTRIBUTES = "snuba-dead-letter-group-attributes"

SPANS = "snuba-spans"
EAP_SPANS_COMMIT_LOG = "snuba-eap-spans-commit-log"
SUBSCRIPTION_SCHEDULED_EAP_SPANS = "scheduled-subscriptions-eap-spans"
SUBSCRIPTION_RESULTS_EAP_SPANS = "eap-spans-subscription-results"
METRICS_SUMMARIES = "snuba-metrics-summaries"
EAP_MUTATIONS = "snuba-eap-mutations"

Expand Down
Loading