Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- Improved PII Scrubbing for attributes / logs ([#5061](https://github.com/getsentry/relay/pull/5061)))
- Introduces a project scope sampling rule type. ([#5077](https://github.com/getsentry/relay/pull/5077)))
- Produce transactions on `transactions` Kafka topic, even if they have attachments. ([#5081](https://github.com/getsentry/relay/pull/5081))
- Removes metric stats from the codebase. ([#5097](https://github.com/getsentry/relay/pull/5097))
- Add option gating Snuba publishing to ingest-replay-events for Replays. ([#5088](https://github.com/getsentry/relay/pull/5088))

## 25.8.0
Expand Down
14 changes: 1 addition & 13 deletions relay-base-schema/src/metrics/mri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ pub enum MetricNamespace {
Spans,
/// User-defined metrics directly sent by SDKs and applications.
Custom,
/// Metric stats.
///
/// Metrics about metrics.
Stats,
/// An unknown and unsupported metric.
///
/// Metrics that Relay either doesn't know or recognize the namespace of will be dropped before
Expand All @@ -132,30 +128,23 @@ pub enum MetricNamespace {

impl MetricNamespace {
/// Returns all namespaces/variants of this enum.
pub fn all() -> [Self; 6] {
pub fn all() -> [Self; 5] {
[
Self::Sessions,
Self::Transactions,
Self::Spans,
Self::Custom,
Self::Stats,
Self::Unsupported,
]
}

/// Returns `true` if metric stats are enabled for this namespace.
pub fn has_metric_stats(&self) -> bool {
matches!(self, Self::Custom)
}

/// Returns the string representation for this metric type.
pub fn as_str(&self) -> &'static str {
match self {
Self::Sessions => "sessions",
Self::Transactions => "transactions",
Self::Spans => "spans",
Self::Custom => "custom",
Self::Stats => "metric_stats",
Self::Unsupported => "unsupported",
}
}
Expand All @@ -170,7 +159,6 @@ impl std::str::FromStr for MetricNamespace {
"transactions" => Ok(Self::Transactions),
"spans" => Ok(Self::Spans),
"custom" => Ok(Self::Custom),
"metric_stats" => Ok(Self::Stats),
_ => Ok(Self::Unsupported),
}
}
Expand Down
3 changes: 0 additions & 3 deletions relay-cogs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ pub enum AppFeature {
MetricsSessions,
/// Metrics in the custom namespace.
MetricsCustom,
/// Metrics in the `metric_stats` namespace.
MetricsStats,
/// Metrics in the unsupported namespace.
///
/// This is usually not emitted, since metrics in the unsupported
Expand All @@ -206,7 +204,6 @@ impl AppFeature {
Self::MetricsSpans => "metrics_spans",
Self::MetricsSessions => "metrics_sessions",
Self::MetricsCustom => "metrics_custom",
Self::MetricsStats => "metrics_metric_stats",
Self::MetricsUnsupported => "metrics_unsupported",
Self::Profiles => "profiles",
}
Expand Down
27 changes: 0 additions & 27 deletions relay-config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,23 +575,6 @@ impl Default for Metrics {
}
}

/// Controls processing of Sentry metrics and metric metadata.
#[derive(Serialize, Deserialize, Debug, Default)]
#[serde(default)]
pub struct SentryMetrics {
/// Whether metric stats are collected and emitted.
///
/// Metric stats are always collected and emitted when processing
/// is enabled.
///
/// This option is required for running multiple trusted Relays in a chain
/// and you want the metric stats to be collected and forwarded from
/// the first Relay in the chain.
///
/// Defaults to `false`.
pub metric_stats_enabled: bool,
}

/// Controls various limits
#[derive(Serialize, Deserialize, Debug)]
#[serde(default)]
Expand Down Expand Up @@ -1612,8 +1595,6 @@ struct ConfigValues {
#[serde(default)]
metrics: Metrics,
#[serde(default)]
sentry_metrics: SentryMetrics,
#[serde(default)]
sentry: relay_log::SentryConfig,
#[serde(default)]
processing: Processing,
Expand Down Expand Up @@ -2365,14 +2346,6 @@ impl Config {
self.values.limits.max_metric_buckets_size.as_bytes()
}

/// Whether metric stats are collected and emitted.
///
/// Metric stats are always collected and emitted when processing
/// is enabled.
pub fn metric_stats_enabled(&self) -> bool {
self.values.sentry_metrics.metric_stats_enabled || self.values.processing.enabled
}

/// Returns the maximum payload size for general API requests.
pub fn max_api_payload_size(&self) -> usize {
self.values.limits.max_api_payload_size.as_bytes()
Expand Down
17 changes: 0 additions & 17 deletions relay-dynamic-config/src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,6 @@ pub struct Options {
)]
pub metric_bucket_dist_encodings: BucketEncodings,

/// Rollout rate for metric stats.
///
/// Rate needs to be between `0.0` and `1.0`.
/// If set to `1.0` all organizations will have metric stats enabled.
#[serde(
rename = "relay.metric-stats.rollout-rate",
deserialize_with = "default_on_error",
skip_serializing_if = "is_default"
)]
pub metric_stats_rollout_rate: f32,

/// Overall sampling of span extraction.
///
/// This number represents the fraction of transactions for which
Expand Down Expand Up @@ -220,7 +209,6 @@ pub struct BucketEncodings {
spans: BucketEncoding,
profiles: BucketEncoding,
custom: BucketEncoding,
metric_stats: BucketEncoding,
}

impl BucketEncodings {
Expand All @@ -230,7 +218,6 @@ impl BucketEncodings {
MetricNamespace::Transactions => self.transactions,
MetricNamespace::Spans => self.spans,
MetricNamespace::Custom => self.custom,
MetricNamespace::Stats => self.metric_stats,
// Always force the legacy encoding for sessions,
// sessions are not part of the generic metrics platform with different
// consumer which are not (yet) updated to support the new data.
Expand Down Expand Up @@ -266,7 +253,6 @@ where
spans: encoding,
profiles: encoding,
custom: encoding,
metric_stats: encoding,
})
}

Expand Down Expand Up @@ -470,7 +456,6 @@ mod tests {
spans: BucketEncoding::Legacy,
profiles: BucketEncoding::Legacy,
custom: BucketEncoding::Legacy,
metric_stats: BucketEncoding::Legacy,
}
);
assert_eq!(
Expand All @@ -480,7 +465,6 @@ mod tests {
spans: BucketEncoding::Zstd,
profiles: BucketEncoding::Zstd,
custom: BucketEncoding::Zstd,
metric_stats: BucketEncoding::Zstd,
}
);
}
Expand All @@ -492,7 +476,6 @@ mod tests {
spans: BucketEncoding::Zstd,
profiles: BucketEncoding::Base64,
custom: BucketEncoding::Zstd,
metric_stats: BucketEncoding::Base64,
};
let s = serde_json::to_string(&original).unwrap();
let s = format!(
Expand Down
1 change: 0 additions & 1 deletion relay-metrics/src/cogs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ fn to_app_feature(ns: MetricNamespace) -> AppFeature {
MetricNamespace::Transactions => AppFeature::MetricsTransactions,
MetricNamespace::Spans => AppFeature::MetricsSpans,
MetricNamespace::Custom => AppFeature::MetricsCustom,
MetricNamespace::Stats => AppFeature::MetricsStats,
MetricNamespace::Unsupported => AppFeature::MetricsUnsupported,
}
}
10 changes: 1 addition & 9 deletions relay-metrics/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ pub struct ByNamespace<T> {
pub spans: T,
/// Value for the [`MetricNamespace::Custom`] namespace.
pub custom: T,
/// Value for the [`MetricNamespace::Stats`] namespace.
pub stats: T,
/// Value for the [`MetricNamespace::Unsupported`] namespace.
pub unsupported: T,
}
Expand All @@ -37,7 +35,6 @@ impl<T> ByNamespace<T> {
MetricNamespace::Transactions => &self.transactions,
MetricNamespace::Spans => &self.spans,
MetricNamespace::Custom => &self.custom,
MetricNamespace::Stats => &self.stats,
MetricNamespace::Unsupported => &self.unsupported,
}
}
Expand All @@ -49,23 +46,21 @@ impl<T> ByNamespace<T> {
MetricNamespace::Transactions => &mut self.transactions,
MetricNamespace::Spans => &mut self.spans,
MetricNamespace::Custom => &mut self.custom,
MetricNamespace::Stats => &mut self.stats,
MetricNamespace::Unsupported => &mut self.unsupported,
}
}
}

impl<T> IntoIterator for ByNamespace<T> {
type Item = (MetricNamespace, T);
type IntoIter = std::array::IntoIter<(MetricNamespace, T), 6>;
type IntoIter = std::array::IntoIter<(MetricNamespace, T), 5>;

fn into_iter(self) -> Self::IntoIter {
let Self {
sessions,
transactions,
spans,
custom,
stats,
unsupported,
} = self;

Expand All @@ -74,7 +69,6 @@ impl<T> IntoIterator for ByNamespace<T> {
(MetricNamespace::Transactions, transactions),
(MetricNamespace::Spans, spans),
(MetricNamespace::Custom, custom),
(MetricNamespace::Stats, stats),
(MetricNamespace::Unsupported, unsupported),
]
.into_iter()
Expand Down Expand Up @@ -118,15 +112,13 @@ macro_rules! impl_op {
transactions,
spans,
custom,
stats,
unsupported,
} = self;

$op::$opfn(sessions, rhs.sessions);
$op::$opfn(transactions, rhs.transactions);
$op::$opfn(spans, rhs.spans);
$op::$opfn(custom, rhs.custom);
$op::$opfn(stats, rhs.stats);
$op::$opfn(unsupported, rhs.unsupported);
}
}
Expand Down
Loading
Loading