Skip to content

Commit

Permalink
feat: Add the scheduled subscription topics (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnagara authored Apr 1, 2024
1 parent 2278258 commit b5f2fcf
Show file tree
Hide file tree
Showing 9 changed files with 185 additions and 8 deletions.
26 changes: 18 additions & 8 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
/schemas/profile-functions.v1.schema.json @getsentry/owners-snuba @getsentry/profiling
/schemas/group-attributes.v1.schema.json @getsentry/owners-snuba @getsentry/issues
/schemas/snuba-spans.v1.schema.json @getsentry/owners-snuba @getsentry/profiling
/schemas/buffered-segments.v1.schema.json @getsentry/owners-snuba @getsentry/performance
/schemas/buffered-segments.v1.schema.json @getsentry/owners-snuba @getsentry/performance
/schemas/snuba-metrics-summaries.v1.schema.json @getsentry/owners-snuba @getsentry/profiling

# Examples
Expand All @@ -74,14 +74,24 @@
# Internal Snuba topics
/topics/snuba-queries.yaml @getsentry/owners-snuba

# Scheduled subscription topics
/topics/scheduled-subscriptions-events.yaml @getsentry/owners-snuba
/topics/scheduled-subscriptions-transactions.yaml @getsentry/owners-snuba
/topics/scheduled-subscriptions-metrics.yaml @getsentry/owners-snuba
/topics/scheduled-subscriptions-generic-metrics-counters.yaml @getsentry/owners-snuba
/topics/scheduled-subscriptions-generic-metrics-sets.yaml @getsentry/owners-snuba
/topics/scheduled-subscriptions-generic-metrics-distributions.yaml @getsentry/owners-snuba



# Subscription results published by Snuba for Sentry's result consumer
/topics/events-subscription-results.yaml @getsentry/owners-snuba @getsentry/issues
/topics/transactions-subscription-results.yaml @getsentry/owners-snuba @getsentry/issues
/topics/sessions-subscription-results.yaml @getsentry/owners-snuba @getsentry/issues
/topics/metrics-subscription-results.yaml @getsentry/owners-snuba @getsentry/issues
/topics/generic-metrics-subscription-results.yaml @getsentry/owners-snuba @getsentry/issues
/schemas/subscription-result.v1.schema.json @getsentry/owners-snuba @getsentry/issues
/examples/subscription-results/ @getsentry/owners-snuba @getsentry/issues
/topics/events-subscription-results.yaml @getsentry/owners-snuba @getsentry/issues
/topics/transactions-subscription-results.yaml @getsentry/owners-snuba @getsentry/issues
/topics/sessions-subscription-results.yaml @getsentry/owners-snuba @getsentry/issues
/topics/metrics-subscription-results.yaml @getsentry/owners-snuba @getsentry/issues
/topics/generic-metrics-subscription-results.yaml @getsentry/owners-snuba @getsentry/issues
/schemas/subscription-result.v1.schema.json @getsentry/owners-snuba @getsentry/issues
/examples/subscription-results/ @getsentry/owners-snuba @getsentry/issues

# Search and storage and infra is the default owner
* @getsentry/owners-snuba @getsentry/ops
16 changes: 16 additions & 0 deletions examples/subscription-scheduled/1/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": 3,
"payload": {
"subscription_id": "1/944ec0c4eed611ee8c912e62feddd7b5",
"request": {
"query": "MATCH (events) SELECT count() AS count",
"tenant_ids": { "referrer": "subscription", "organization_id": 1 }
},
"result": {
"data": [{ "count": 1 }],
"meta": [{ "type": "UInt64", "name": "count" }]
},
"timestamp": "2024-03-30T13:46:27.363030",
"entity": "events"
}
}
49 changes: 49 additions & 0 deletions schemas/subscription-scheduled.v1.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"version": {
"type": "integer"
},
"payload": {
"type": "object",
"properties": {
"subscription_id": {
"type": "string"
},
"request": {
"type": "object"
},
"result": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object"
}
},
"meta": {
"type": "array"
}
},
"required": ["data", "meta"]
},
"timestamp": {
"type": "string"
},
"entity": {
"type": "string"
}
},
"required": [
"entity",
"request",
"result",
"subscription_id",
"timestamp"
]
}
},
"required": ["payload", "version"]
}
17 changes: 17 additions & 0 deletions topics/scheduled-subscriptions-events.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
topic: scheduled-subscriptions-events
pipeline: errors
description: Scheduled subscriptions for errors pipeline
services:
producers:
- getsentry/snuba
consumers:
- getsentry/snuba
schemas:
- version: 1
compatibility_mode: none
type: json
resource: subscription-scheduled.v1.schema.json
examples:
- subscription-scheduled/1/
topic_creation_config:
compression.type: lz4
17 changes: 17 additions & 0 deletions topics/scheduled-subscriptions-generic-metrics-counters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
topic: scheduled-subscriptions-generic-metrics-counters
pipeline: generic-metrics
description: Scheduled subscriptions
services:
producers:
- getsentry/snuba
consumers:
- getsentry/snuba
schemas:
- version: 1
compatibility_mode: none
type: json
resource: subscription-scheduled.v1.schema.json
examples:
- subscription-scheduled/1/
topic_creation_config:
compression.type: lz4
17 changes: 17 additions & 0 deletions topics/scheduled-subscriptions-generic-metrics-distributions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
topic: scheduled-subscriptions-generic-metrics-distributions
pipeline: generic-metrics
description: Scheduled subscriptions
services:
producers:
- getsentry/snuba
consumers:
- getsentry/snuba
schemas:
- version: 1
compatibility_mode: none
type: json
resource: subscription-scheduled.v1.schema.json
examples:
- subscription-scheduled/1/
topic_creation_config:
compression.type: lz4
17 changes: 17 additions & 0 deletions topics/scheduled-subscriptions-generic-metrics-sets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
topic: scheduled-subscriptions-generic-metrics-sets
pipeline: generic-metrics
description: Scheduled subscriptions
services:
producers:
- getsentry/snuba
consumers:
- getsentry/snuba
schemas:
- version: 1
compatibility_mode: none
type: json
resource: subscription-scheduled.v1.schema.json
examples:
- subscription-scheduled/1/
topic_creation_config:
compression.type: lz4
17 changes: 17 additions & 0 deletions topics/scheduled-subscriptions-metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
topic: scheduled-subscriptions-metrics
pipeline: release-health
description: Scheduled subscriptions
services:
producers:
- getsentry/snuba
consumers:
- getsentry/snuba
schemas:
- version: 1
compatibility_mode: none
type: json
resource: subscription-scheduled.v1.schema.json
examples:
- subscription-scheduled/1/
topic_creation_config:
compression.type: lz4
17 changes: 17 additions & 0 deletions topics/scheduled-subscriptions-transactions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
topic: scheduled-subscriptions-transactions
pipeline: transactions
description: Scheduled subscriptions
services:
producers:
- getsentry/snuba
consumers:
- getsentry/snuba
schemas:
- version: 1
compatibility_mode: none
type: json
resource: subscription-scheduled.v1.schema.json
examples:
- subscription-scheduled/1/
topic_creation_config:
compression.type: lz4

0 comments on commit b5f2fcf

Please sign in to comment.