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(metrics): Support dedicated topics per metrics usecase, drop metrics from unknown usecases [INGEST-1309] #1285

Merged
merged 19 commits into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from 16 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Avoid potential panics when scrubbing minidumps. ([#1282](https://github.com/getsentry/relay/pull/1282))
- Fix typescript profile validation. ([#1283](https://github.com/getsentry/relay/pull/1283))
- Track memory footprint of metrics buckets. ([#1284](https://github.com/getsentry/relay/pull/1284), [#1287](https://github.com/getsentry/relay/pull/1287), [#1288](https://github.com/getsentry/relay/pull/1288))
- Support dedicated topics per metrics usecase, drop metrics from unknown usecases. ([#1285](https://github.com/getsentry/relay/pull/1285))

## 22.5.0

Expand Down
21 changes: 17 additions & 4 deletions relay-config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,10 @@ pub enum KafkaTopic {
OutcomesBilling,
/// Session health updates.
Sessions,
/// Aggregate Metrics.
Metrics,
/// Any metric that is extracted from sessions.
MetricsSessions,
/// Any metric that is extracted from transactions.
MetricsTransactions,
/// Profiles
Profiles,
}
Expand All @@ -801,8 +803,14 @@ pub struct TopicAssignments {
pub outcomes_billing: Option<TopicAssignment>,
/// Session health topic name.
pub sessions: TopicAssignment,
/// Metrics topic name.
/// Default topic name for all aggregate metrics. Specialized topics for session-based and
/// transaction-based metrics can be configured via `metrics_sessions` and
/// `metrics_transactions` each.
pub metrics: TopicAssignment,
/// Topic name for metrics extracted from sessions. Defaults to the assignment of `metrics`.
pub metrics_sessions: Option<TopicAssignment>,
/// Topic name for metrics extracted from transactions. Defaults to the assignment of `metrics`.
pub metrics_transactions: Option<TopicAssignment>,
Copy link
Member

Choose a reason for hiding this comment

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

nit: If we introduce a MetricNamespace enum, this could become a mapping of MetricNamespace => TopicAssignment, which would allow for more generic code in all other places. Provided that all unknown namespace strings are mapped to MetricNamespace::Unknown, this would even allow to create config before updating Relay.

I have not fully thought through all implications here, however.

/// Stacktrace topic name
pub profiles: TopicAssignment,
}
Expand All @@ -817,7 +825,10 @@ impl TopicAssignments {
KafkaTopic::Outcomes => &self.outcomes,
KafkaTopic::OutcomesBilling => self.outcomes_billing.as_ref().unwrap_or(&self.outcomes),
KafkaTopic::Sessions => &self.sessions,
KafkaTopic::Metrics => &self.metrics,
KafkaTopic::MetricsSessions => self.metrics_sessions.as_ref().unwrap_or(&self.metrics),
KafkaTopic::MetricsTransactions => {
self.metrics_transactions.as_ref().unwrap_or(&self.metrics)
}
KafkaTopic::Profiles => &self.profiles,
}
}
Expand All @@ -833,6 +844,8 @@ impl Default for TopicAssignments {
outcomes_billing: None,
sessions: "ingest-sessions".to_owned().into(),
metrics: "ingest-metrics".to_owned().into(),
metrics_sessions: None,
metrics_transactions: None,
profiles: "profiles".to_owned().into(),
}
}
Expand Down
Loading