Skip to content

Commit

Permalink
ref(metric-meta): Removes all metric meta code from Relay
Browse files Browse the repository at this point in the history
  • Loading branch information
Dav1dde committed Oct 21, 2024
1 parent fa1b254 commit d5012d9
Show file tree
Hide file tree
Showing 26 changed files with 33 additions and 1,158 deletions.
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Changelog

## Unreleased

**Breaking Changes**:

- Removes support for metric meta envelope items. ([#4152](https://github.com/getsentry/relay/pull/4152))

## 24.10.0

**Breaking Changes:**
**Breaking Changes**:

- Only allow processing enabled in managed mode. ([#4087](https://github.com/getsentry/relay/pull/4087))

Expand All @@ -12,7 +18,7 @@
- Use the duration reported by the profiler instead of the transaction. ([#4058](https://github.com/getsentry/relay/pull/4058))
- Incorrect pattern matches involving adjacent any and wildcard matchers. ([#4072](https://github.com/getsentry/relay/pull/4072))

**Features:**
**Features**:

- Add a config option to add default tags to all Relay Sentry events. ([#3944](https://github.com/getsentry/relay/pull/3944))
- Automatically derive `client.address` and `user.geo` for standalone spans. ([#4047](https://github.com/getsentry/relay/pull/4047))
Expand All @@ -23,7 +29,7 @@
- Add support for creating User from LoginId in Unreal Crash Context. ([#4093](https://github.com/getsentry/relay/pull/4093))
- Add multi-write Redis client. ([#4064](https://github.com/getsentry/relay/pull/4064))

**Internal:**
**Internal**:

- Remove unused `cogs.enabled` configuration option. ([#4060](https://github.com/getsentry/relay/pull/4060))
- Add the dynamic sampling rate to standalone spans as a measurement so that it can be stored, queried, and used for extrapolation. ([#4063](https://github.com/getsentry/relay/pull/4063))
Expand Down
4 changes: 0 additions & 4 deletions relay-cogs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ pub enum AppFeature {
/// This app feature is for continuous profiling.
Profiles,

/// Metric metadata.
MetricMeta,

/// Metrics in the transactions namespace.
MetricsTransactions,
/// Metrics in the spans namespace.
Expand Down Expand Up @@ -168,7 +165,6 @@ impl AppFeature {
Self::ClientReports => "client_reports",
Self::CheckIns => "check_ins",
Self::Replays => "replays",
Self::MetricMeta => "metric_meta",
Self::MetricsTransactions => "metrics_transactions",
Self::MetricsSpans => "metrics_spans",
Self::MetricsProfiles => "metrics_profiles",
Expand Down
38 changes: 1 addition & 37 deletions relay-config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,17 +559,9 @@ impl Default for Metrics {
}

/// Controls processing of Sentry metrics and metric metadata.
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize, Debug, Default)]
#[serde(default)]
struct SentryMetrics {
/// Code locations expiry in seconds.
///
/// Defaults to 15 days.
pub meta_locations_expiry: u64,
/// Maximum amount of code locations to store per metric.
///
/// Defaults to 5.
pub meta_locations_max: usize,
/// Whether metric stats are collected and emitted.
///
/// Metric stats are always collected and emitted when processing
Expand All @@ -583,16 +575,6 @@ struct SentryMetrics {
pub metric_stats_enabled: bool,
}

impl Default for SentryMetrics {
fn default() -> Self {
Self {
meta_locations_expiry: 15 * 24 * 60 * 60,
meta_locations_max: 5,
metric_stats_enabled: false,
}
}
}

/// Controls various limits
#[derive(Serialize, Deserialize, Debug)]
#[serde(default)]
Expand Down Expand Up @@ -633,8 +615,6 @@ struct Limits {
max_statsd_size: ByteSize,
/// The maximum payload size for metric buckets.
max_metric_buckets_size: ByteSize,
/// The maximum payload size for metric metadata.
max_metric_meta_size: ByteSize,
/// The maximum payload size for a compressed replay.
max_replay_compressed_size: ByteSize,
/// The maximum payload size for an uncompressed replay.
Expand Down Expand Up @@ -686,7 +666,6 @@ impl Default for Limits {
max_span_size: ByteSize::mebibytes(1),
max_statsd_size: ByteSize::mebibytes(1),
max_metric_buckets_size: ByteSize::mebibytes(1),
max_metric_meta_size: ByteSize::mebibytes(1),
max_replay_compressed_size: ByteSize::mebibytes(10),
max_replay_uncompressed_size: ByteSize::mebibytes(100),
max_replay_message_size: ByteSize::mebibytes(15),
Expand Down Expand Up @@ -2071,16 +2050,6 @@ impl Config {
self.values.metrics.sample_rate
}

/// Returns the maximum amount of code locations per metric.
pub fn metrics_meta_locations_max(&self) -> usize {
self.values.sentry_metrics.meta_locations_max
}

/// Returns the expiry for code locations.
pub fn metrics_meta_locations_expiry(&self) -> Duration {
Duration::from_secs(self.values.sentry_metrics.meta_locations_expiry)
}

/// Returns the interval for periodic metrics emitted from Relay.
///
/// `None` if periodic metrics are disabled.
Expand Down Expand Up @@ -2296,11 +2265,6 @@ impl Config {
self.values.limits.max_metric_buckets_size.as_bytes()
}

/// Returns the maximum payload size of metric metadata in bytes.
pub fn max_metric_meta_size(&self) -> usize {
self.values.limits.max_metric_meta_size.as_bytes()
}

/// Whether metric stats are collected and emitted.
///
/// Metric stats are always collected and emitted when processing
Expand Down
63 changes: 0 additions & 63 deletions relay-config/src/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ pub enum RedisConfigs {
cardinality: Box<RedisConfig>,
/// Configuration for the `quotas` pool.
quotas: Box<RedisConfig>,
/// Configuration for the `misc` pool.
misc: Box<RedisConfig>,
},
}

Expand Down Expand Up @@ -221,8 +219,6 @@ pub enum RedisPoolConfigs<'a> {
cardinality: RedisConfigRef<'a>,
/// Configuration for the `quotas` pool.
quotas: RedisConfigRef<'a>,
/// Configuration for the `misc` pool.
misc: RedisConfigRef<'a>,
},
}

Expand Down Expand Up @@ -292,18 +288,15 @@ pub(super) fn create_redis_pools(configs: &RedisConfigs, cpu_concurrency: u32) -
project_configs,
cardinality,
quotas,
misc,
} => {
let project_configs =
create_redis_pool(project_configs, project_configs_default_connections);
let cardinality = create_redis_pool(cardinality, cpu_concurrency);
let quotas = create_redis_pool(quotas, cpu_concurrency);
let misc = create_redis_pool(misc, cpu_concurrency);
RedisPoolConfigs::Individual {
project_configs,
cardinality,
quotas,
misc,
}
}
}
Expand Down Expand Up @@ -378,16 +371,6 @@ quotas:
- "redis://127.0.0.2:6379"
max_connections: 17
connection_timeout: 5
misc:
configs:
- cluster_nodes:
- "redis://127.0.0.1:6379"
- "redis://127.0.0.2:6379"
max_connections: 42
connection_timeout: 5
- server: "redis://127.0.0.1:6379"
max_connections: 84
connection_timeout: 10
"#;

let configs: RedisConfigs = serde_yaml::from_str(yaml)
Expand Down Expand Up @@ -417,29 +400,6 @@ misc:
..Default::default()
},
}),
misc: Box::new(RedisConfig::MultiWrite {
configs: vec![
RedisConfig::Cluster {
cluster_nodes: vec![
"redis://127.0.0.1:6379".to_owned(),
"redis://127.0.0.2:6379".to_owned(),
],
options: PartialRedisConfigOptions {
max_connections: Some(42),
connection_timeout: 5,
..Default::default()
},
},
RedisConfig::Single(SingleRedisConfig::Detailed {
server: "redis://127.0.0.1:6379".to_owned(),
options: PartialRedisConfigOptions {
max_connections: Some(84),
connection_timeout: 10,
..Default::default()
},
}),
],
}),
};

assert_eq!(configs, expected);
Expand Down Expand Up @@ -733,17 +693,6 @@ read_timeout: 10
}),
],
}),
misc: Box::new(RedisConfig::Cluster {
cluster_nodes: vec![
"redis://127.0.0.1:6379".to_owned(),
"redis://127.0.0.2:6379".to_owned(),
],
options: PartialRedisConfigOptions {
max_connections: Some(84),
connection_timeout: 10,
..Default::default()
},
}),
};

assert_json_snapshot!(configs, @r###"
Expand Down Expand Up @@ -789,18 +738,6 @@ read_timeout: 10
"write_timeout": 3
}
]
},
"misc": {
"cluster_nodes": [
"redis://127.0.0.1:6379",
"redis://127.0.0.2:6379"
],
"max_connections": 84,
"connection_timeout": 10,
"max_lifetime": 300,
"idle_timeout": 60,
"read_timeout": 3,
"write_timeout": 3
}
}
"###);
Expand Down
4 changes: 0 additions & 4 deletions relay-metrics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@

pub mod aggregator;
pub mod cogs;
pub mod meta;

mod bucket;
mod finite;
Expand All @@ -80,8 +79,5 @@ mod view;

pub use bucket::*;
pub use finite::*;
#[cfg(feature = "redis")]
pub use meta::RedisMetricMetaStore;
pub use meta::{MetaAggregator, MetricMeta};
pub use protocol::*;
pub use view::*;
Loading

0 comments on commit d5012d9

Please sign in to comment.