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
ref: Kafka topic configuration #3282
Conversation
As part of the kafka control plane project, Kafka config for all Sentry services should be automatically generated from a single source of truth in ops/sentry-kafka-schemas. The system knows about the default topic name + override value per environment, but is not aware of the Relay specific values like "events" and "metrics". This is aligned with the configuration format of Sentry, Snuba and super-big-consumers.
pub struct TopicAssignments { | ||
/// Simple events topic name. | ||
#[serde(alias = "ingest-events")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alias is supposed to be temporary, while we cut over config in ops. Later this should change to rename
@@ -156,8 +167,7 @@ impl Default for TopicAssignments { | |||
outcomes: "outcomes".to_owned().into(), | |||
outcomes_billing: None, | |||
sessions: "ingest-sessions".to_owned().into(), | |||
metrics: "ingest-metrics".to_owned().into(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this because I think it's confusing / error prone. There shouldn't be a metrics default. Only 2 completely separate topics for either release health metrics and generic metrics.
@@ -156,8 +167,7 @@ impl Default for TopicAssignments { | |||
outcomes: "outcomes".to_owned().into(), | |||
outcomes_billing: None, | |||
sessions: "ingest-sessions".to_owned().into(), | |||
metrics: "ingest-metrics".to_owned().into(), | |||
metrics_sessions: None, | |||
metrics_sessions: "ingest-metrics".to_owned().into(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now there is duplication here between in default and the "alias" values, which I would like to avoid. Not sure the best way to tackle this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's fine.
relay-kafka/src/config.rs
Outdated
/// Topic name for metrics extracted from sessions. Defaults to the assignment of `metrics`. | ||
pub metrics_sessions: Option<TopicAssignment>, | ||
/// Topic name for metrics extracted from sessions, aka release health. | ||
#[serde(alias = "metrics")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is tricky, if both metrics
and ingest-metrics
are defined the precedence isn't clear (it was before). That being sad, I do like the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intended to be very temporary just while we cut things over in production. After the migration I think we should be very strict and only support the actual topic names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant, that if someone currently has both topics configured the precedence has now changed, which is a breaking change and this might affect us as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I double checked ST and prod -- we don't use both in any of the environments we control at least.
@@ -156,8 +167,7 @@ impl Default for TopicAssignments { | |||
outcomes: "outcomes".to_owned().into(), | |||
outcomes_billing: None, | |||
sessions: "ingest-sessions".to_owned().into(), | |||
metrics: "ingest-metrics".to_owned().into(), | |||
metrics_sessions: None, | |||
metrics_sessions: "ingest-metrics".to_owned().into(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's fine.
CHANGELOG.md
Outdated
@@ -1,6 +1,7 @@ | |||
# Changelog | |||
|
|||
## Unreleased | |||
- Kafka topic config supports default topic names as keys ([#3282](https://github.com/getsentry/relay/pull/3282)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Kafka topic config supports default topic names as keys ([#3282](https://github.com/getsentry/relay/pull/3282)) | |
- Kafka topic config supports default topic names as keys. ([#3282](https://github.com/getsentry/relay/pull/3282)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, is this normally generated by hand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, usually done by hand, but many PRs without impact have no changelog entry (this one should)
relay-kafka/src/config.rs
Outdated
/// Topic name for metrics extracted from sessions. Defaults to the assignment of `metrics`. | ||
pub metrics_sessions: Option<TopicAssignment>, | ||
/// Topic name for metrics extracted from sessions, aka release health. | ||
#[serde(alias = "metrics")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant, that if someone currently has both topics configured the precedence has now changed, which is a breaking change and this might affect us as well.
relay-kafka/src/config.rs
Outdated
pub transactions: TopicAssignment, | ||
/// Outcomes topic name. | ||
#[serde(alias = "outcomes")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Field is already called outcomes.
relay-kafka/src/config.rs
Outdated
#[serde(alias = "metrics_transactions")] | ||
#[serde(alias = "ingest-generic-metrics")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[serde(alias = "metrics_transactions")] | |
#[serde(alias = "ingest-generic-metrics")] | |
#[serde(alias = "metrics_transactions", alias = "ingest-generic-metrics")] |
CHANGELOG.md
Outdated
@@ -1,6 +1,7 @@ | |||
# Changelog | |||
|
|||
## Unreleased | |||
- Kafka topic config supports default topic names as keys ([#3282](https://github.com/getsentry/relay/pull/3282)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move it to the Internal
section.
As part of the kafka control plane project, Kafka config for all Sentry services should be automatically generated from a single source of truth in the ops/sentry-kafka-schemas repos.
The system knows about the default topic name + any override value per environment if relevant, but is not aware of the Relay specific values like "events" and "metrics".
This is aligned with the configuration format of Sentry, Snuba and super-big-consumers.