Skip to content

Commit

Permalink
ref: remove redundant property from topic files (#299)
Browse files Browse the repository at this point in the history
it's already specified in the filename, we can also remove the test that asserts they are the same
  • Loading branch information
lynnagara committed Jun 6, 2024
1 parent a8e93af commit 0b0aa09
Show file tree
Hide file tree
Showing 63 changed files with 9 additions and 68 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,22 @@ Example messages must be stripped of **all** customer related data. This also in

Each topic is a yaml file in the topics directory. This topic name is a "logical" topic name as many services in Sentry support overriding the default name to a different physical topic name if desired. Topic names must be unique in Sentry: the same name cannot be used for different types of data.

The yaml file of a topic has 2 keys:
The yaml file of a topic has the following keys:

1. `topic`. This is the logical topic name. It must match the filename.
1. `schemas`. Schemas is an array. The following should be provided for each schema:

2. `schemas`. Schemas is an array. The following should be provided for each schema:
- `version`: Incrementing integer. Should start at 1.
- `compatibility_mode`: `none` or `backward`.
- `type`: Can be either `json` or `msgpack`. In both cases we use
jsonschema to define the message schema.
- `resource`: Should match the file name in the `schemas` directory
- `examples`: Should match the file names in the `examples` directory

2. `topic_configuration_config`. Configuration used to create the topic
3. `services`. Which Sentry services produce to and consume from the topic.
4. `description`.
5. `pipeline`.

## Using the schema (in Python)

```python
Expand Down
6 changes: 2 additions & 4 deletions python/tests/test_valid_topic_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
_TOPIC_SCHEMA = fastjsonschema.compile(
{
"properties": {
"topic": {"type": "string"},
"description": {"type": "string"},
"pipeline": {"type": "string"},
"services": {
Expand Down Expand Up @@ -54,7 +53,7 @@
},
},
"aditionalProperties": False,
"required": ["topic", "description", "services"],
"required": ["description", "services"],
"definitions": {
"Repo": {
"enum": [
Expand Down Expand Up @@ -91,8 +90,7 @@ def test_all_topics() -> None:
_TOPIC_SCHEMA(topic_data)

# Check valid topic name
topic_name = topic_data["topic"]
assert topic_name == filename.stem
topic_name = filename.stem
assert valid_chars.match(topic_name)
assert len(topic_name) <= 255

Expand Down
1 change: 0 additions & 1 deletion rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ struct TopicSchema {

#[derive(Debug, PartialEq, Serialize, Deserialize)]
struct TopicData {
topic: String,
schemas: Vec<TopicSchema>,
}

Expand Down
1 change: 0 additions & 1 deletion topics/buffered-segments-dlq.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: buffered-segments-dlq
description: DLQ for buffered-segments
services:
producers:
Expand Down
1 change: 0 additions & 1 deletion topics/buffered-segments.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: buffered-segments
description: List of buffered spans for a segment
services:
producers:
Expand Down
1 change: 0 additions & 1 deletion topics/event-replacements.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: event-replacements
description: Error replacements
services:
producers:
Expand Down
1 change: 0 additions & 1 deletion topics/events-subscription-results.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: events-subscription-results
pipeline: errors
description: Events Subscription Results
services:
Expand Down
1 change: 0 additions & 1 deletion topics/events.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: events
pipeline: errors
description: Errors data for Snuba
services:
Expand Down
1 change: 0 additions & 1 deletion topics/generic-events.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: generic-events
pipeline: generic-events
description: Issue platform
services:
Expand Down
1 change: 0 additions & 1 deletion topics/generic-metrics-subscription-results.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: generic-metrics-subscription-results
pipeline: generic-metrics
description: Generic Metrics Subscription Results
services:
Expand Down
1 change: 0 additions & 1 deletion topics/group-attributes.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: group-attributes
description: A snapshot of Group/Issue attributes replicated from sentry
services:
producers:
Expand Down
1 change: 0 additions & 1 deletion topics/ingest-attachments-dlq.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: ingest-attachments-dlq
pipeline: attachments
description: DLQ for ingest-attachments
services:
Expand Down
1 change: 0 additions & 1 deletion topics/ingest-attachments.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: ingest-attachments
pipeline: attachments
description: Attachments data from Relay
services:
Expand Down
1 change: 0 additions & 1 deletion topics/ingest-events-dlq.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: ingest-events-dlq
pipeline: errors
description: DLQ for ingest-events
services:
Expand Down
1 change: 0 additions & 1 deletion topics/ingest-events.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: ingest-events
pipeline: errors
description: Errors data from Relay
services:
Expand Down
1 change: 0 additions & 1 deletion topics/ingest-feedback-events-dlq.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: ingest-feedback-events-dlq
pipeline: user-feedback
description: DLQ for ingest-feedback-events
services:
Expand Down
1 change: 0 additions & 1 deletion topics/ingest-feedback-events.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: ingest-feedback-events
pipeline: user-feedback
description: User feedback events from SDK
services:
Expand Down
1 change: 0 additions & 1 deletion topics/ingest-generic-metrics-dlq.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: ingest-generic-metrics-dlq
pipeline: release-health
description: DLQ for ingest-performance-metrics
services:
Expand Down
1 change: 0 additions & 1 deletion topics/ingest-metrics-dlq.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: ingest-metrics-dlq
pipeline: release-health
description: DLQ for ingest-metrics
services:
Expand Down
1 change: 0 additions & 1 deletion topics/ingest-metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: ingest-metrics
pipeline: release-health
description: release health metrics (before indexer)
services:
Expand Down
1 change: 0 additions & 1 deletion topics/ingest-monitors.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: ingest-monitors
pipeline: monitors
description: cron monitor check-in ingest
services:
Expand Down
1 change: 0 additions & 1 deletion topics/ingest-performance-metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: ingest-performance-metrics
pipeline: generic-metrics
description: performance metrics and soon also other usecases for generic-metrics (before indexer)
services:
Expand Down
1 change: 0 additions & 1 deletion topics/ingest-replay-events.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: ingest-replay-events
pipeline: replays
description: Replay events data for Snuba
services:
Expand Down
1 change: 0 additions & 1 deletion topics/ingest-replay-recordings.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: ingest-replay-recordings
pipeline: replays
description: Replay Recording payloads
services:
Expand Down
1 change: 0 additions & 1 deletion topics/ingest-transactions-dlq.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: ingest-transactions-dlq
pipeline: transactions
description: DLQ for ingest-transactions
services:
Expand Down
1 change: 0 additions & 1 deletion topics/metrics-subscription-results.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: metrics-subscription-results
pipeline: release-health
description: Metrics Subscription Results
services:
Expand Down
1 change: 0 additions & 1 deletion topics/monitors-clock-tasks.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: monitors-clock-tasks
pipeline: monitors
description: cron monitor clock based tasks
services:
Expand Down
1 change: 0 additions & 1 deletion topics/monitors-clock-tick.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: monitors-clock-tick
pipeline: monitors
description: cron monitor clock ticks
services:
Expand Down
1 change: 0 additions & 1 deletion topics/outcomes-billing.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: outcomes-billing
pipeline: outcomes
description: Outcomes for events sent to sentry
services:
Expand Down
1 change: 0 additions & 1 deletion topics/outcomes.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: outcomes
pipeline: outcomes
description: Outcomes for events sent to sentry
services:
Expand Down
1 change: 0 additions & 1 deletion topics/processed-profiles.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: processed-profiles
pipeline: profiles
description: Profile metadata extracted from profiles for Snuba
services:
Expand Down
1 change: 0 additions & 1 deletion topics/profiles-call-tree.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: profiles-call-tree
pipeline: profiles
description: Function data extracted from profiles for Snuba
services:
Expand Down
1 change: 0 additions & 1 deletion topics/scheduled-subscriptions-events.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: scheduled-subscriptions-events
pipeline: errors
description: Scheduled subscriptions for errors pipeline
services:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: scheduled-subscriptions-generic-metrics-counters
pipeline: generic-metrics
description: Scheduled subscriptions
services:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: scheduled-subscriptions-generic-metrics-distributions
pipeline: generic-metrics
description: Scheduled subscriptions
services:
Expand Down
1 change: 0 additions & 1 deletion topics/scheduled-subscriptions-generic-metrics-gauges.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: scheduled-subscriptions-generic-metrics-gauges
pipeline: generic-metrics
description: Scheduled subscriptions
services:
Expand Down
1 change: 0 additions & 1 deletion topics/scheduled-subscriptions-generic-metrics-sets.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: scheduled-subscriptions-generic-metrics-sets
pipeline: generic-metrics
description: Scheduled subscriptions
services:
Expand Down
1 change: 0 additions & 1 deletion topics/scheduled-subscriptions-metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: scheduled-subscriptions-metrics
pipeline: release-health
description: Scheduled subscriptions
services:
Expand Down
1 change: 0 additions & 1 deletion topics/scheduled-subscriptions-transactions.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: scheduled-subscriptions-transactions
pipeline: transactions
description: Scheduled subscriptions
services:
Expand Down
1 change: 0 additions & 1 deletion topics/shared-resources-usage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: shared-resources-usage
description: CoGS data extracted from various resources
services:
producers:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-commit-log.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-commit-log
pipeline: errors
description: Commit log topic for errors pipeline
services:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-dead-letter-generic-events.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-dead-letter-generic-events
pipeline: generic-events
description: DLQ for generic-events
services:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-dead-letter-generic-metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-dead-letter-generic-metrics
pipeline: errors
description: DLQ for snuba-generic-metrics
services:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-dead-letter-group-attributes.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-dead-letter-group-attributes
pipeline: errors
description: DLQ for group-attributes
services:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-dead-letter-metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-dead-letter-metrics
pipeline: errors
description: DLQ for snuba-metrics
services:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-dead-letter-querylog.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-dead-letter-querylog
pipeline: errors
description: DLQ for snuba-queries
services:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-dead-letter-replays.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-dead-letter-replays
pipeline: errors
description: DLQ for ingest-replay-events
services:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-generic-events-commit-log.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-generic-events-commit-log
pipeline: generic-events
description: Commit log topic for generic events pipeline
services:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-generic-metrics-counters-commit-log.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-generic-metrics-counters-commit-log
pipeline: generic-metrics
description: Commit log topic for generic metrics counters pipeline
services:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-generic-metrics-distributions-commit-log.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-generic-metrics-distributions-commit-log
pipeline: generic-metrics
description: Commit log topic for generic metrics distributions pipeline
services:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-generic-metrics-gauges-commit-log.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-generic-metrics-gauges-commit-log
pipeline: generic-metrics
description: Commit log topic for generic metrics gauges pipeline
services:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-generic-metrics-sets-commit-log.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-generic-metrics-sets-commit-log
pipeline: generic-metrics
description: Commit log topic for generic metrics sets pipeline
services:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-generic-metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-generic-metrics
pipeline: generic-metrics
description: Generic metrics for Snuba
services:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-metrics-commit-log.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-metrics-commit-log
pipeline: release-health
description: Commit log topic for release health pipeline
services:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-metrics-summaries.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-metrics-summaries
description: Metrics summaries for spans
services:
producers:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-metrics
pipeline: release-health
description: Release health metrics
services:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-profile-chunks.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-profile-chunks
description: Profile chunks for continuous profiling
services:
producers:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-queries.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-queries
description: Snuba querylog
services:
consumers:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-spans.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-spans
description: Snuba spans only
services:
producers:
Expand Down
1 change: 0 additions & 1 deletion topics/snuba-transactions-commit-log.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: snuba-transactions-commit-log
pipeline: transactions
description: Commit log topic for transactions pipeline
services:
Expand Down
1 change: 0 additions & 1 deletion topics/transactions-subscription-results.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: transactions-subscription-results
pipeline: transactions
description: Transactions Subscription Results
services:
Expand Down
1 change: 0 additions & 1 deletion topics/transactions.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: transactions
pipeline: transactions
description: Transactions data for Snuba
services:
Expand Down
1 change: 0 additions & 1 deletion topics/uptime-results.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
topic: uptime-results
pipeline: uptime
description: uptime check results
services:
Expand Down

0 comments on commit 0b0aa09

Please sign in to comment.