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(generic-metrics): Add support for subscriptions to gauges #5736

Merged
merged 5 commits into from
Apr 25, 2024
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
13 changes: 13 additions & 0 deletions snuba/cli/devserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,19 @@ def devserver(*, bootstrap: bool, workers: bool) -> None:
"--schedule-ttl=10",
],
),
(
"subscriptions-scheduler-generic-metrics-gauges",
[
"snuba",
"subscriptions-scheduler",
"--entity=generic_metrics_gauges",
"--consumer-group=snuba-generic-metrics-gauges-subscriptions-schedulers",
"--followed-consumer-group=snuba-generic-metrics-gauges-consumers",
"--auto-offset-reset=latest",
"--log-level=debug",
"--schedule-ttl=10",
],
),
(
"subscriptions-executor-metrics",
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ schema:
{
name: tags.raw_value,
type: Array,
args:
{
schema_modifiers: [readonly],
inner_type: { type: String },
},
args: { schema_modifiers: [readonly], inner_type: { type: String } },
},
{
name: min,
Expand Down Expand Up @@ -259,3 +255,14 @@ validators:
required_filter_columns: ["org_id", "project_id"]
required_time_column: timestamp
partition_key_column_name: org_id
subscription_processors:
- processor: AddColumnCondition
args:
extra_condition_data_key: organization
extra_condition_column: org_id
subscription_validators:
- validator: AggregationValidator
args:
max_allowed_aggregations: 3
disallowed_aggregations: [having, orderby]
required_time_column: timestamp
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,10 @@ stream_loader:
args:
header_key: metric_type
header_value: g
commit_log_topic: snuba-generic-metrics-gauges-commit-log
subscription_scheduler_mode: global
subscription_synchronization_timestamp: orig_message_ts
subscription_scheduled_topic: scheduled-subscriptions-generic-metrics-gauges
subscription_result_topic: generic-metrics-subscription-results
subscription_delay_seconds: 60
dlq_topic: snuba-dead-letter-generic-metrics
4 changes: 4 additions & 0 deletions snuba/utils/streams/topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class Topic(Enum):
SUBSCRIPTION_SCHEDULED_GENERIC_METRICS_COUNTERS = (
"scheduled-subscriptions-generic-metrics-counters"
)
SUBSCRIPTION_SCHEDULED_GENERIC_METRICS_GAUGES = (
"scheduled-subscriptions-generic-metrics-gauges"
)

SUBSCRIPTION_RESULTS_EVENTS = "events-subscription-results"
SUBSCRIPTION_RESULTS_TRANSACTIONS = "transactions-subscription-results"
Expand All @@ -49,6 +52,7 @@ class Topic(Enum):
"snuba-generic-metrics-distributions-commit-log"
)
GENERIC_METRICS_COUNTERS_COMMIT_LOG = "snuba-generic-metrics-counters-commit-log"
GENERIC_METRICS_GAUGES_COMMIT_LOG = "snuba-generic-metrics-gauges-commit-log"
GENERIC_EVENTS = "generic-events"
GENERIC_EVENTS_COMMIT_LOG = "snuba-generic-events-commit-log"
GROUP_ATTRIBUTES = "group-attributes"
Expand Down
Loading