diff --git a/relay-base-schema/src/metrics/mri.rs b/relay-base-schema/src/metrics/mri.rs index dc4ce08755..f8eddf555c 100644 --- a/relay-base-schema/src/metrics/mri.rs +++ b/relay-base-schema/src/metrics/mri.rs @@ -112,8 +112,6 @@ pub enum MetricNamespace { Transactions, /// Metrics extracted from spans. Spans, - /// Metrics extracted from profile functions. - Profiles, /// User-defined metrics directly sent by SDKs and applications. Custom, /// Metric stats. @@ -134,12 +132,11 @@ pub enum MetricNamespace { impl MetricNamespace { /// Returns all namespaces/variants of this enum. - pub fn all() -> [Self; 7] { + pub fn all() -> [Self; 6] { [ Self::Sessions, Self::Transactions, Self::Spans, - Self::Profiles, Self::Custom, Self::Stats, Self::Unsupported, @@ -157,7 +154,6 @@ impl MetricNamespace { Self::Sessions => "sessions", Self::Transactions => "transactions", Self::Spans => "spans", - Self::Profiles => "profiles", Self::Custom => "custom", Self::Stats => "metric_stats", Self::Unsupported => "unsupported", @@ -173,7 +169,6 @@ impl std::str::FromStr for MetricNamespace { "sessions" => Ok(Self::Sessions), "transactions" => Ok(Self::Transactions), "spans" => Ok(Self::Spans), - "profiles" => Ok(Self::Profiles), "custom" => Ok(Self::Custom), "metric_stats" => Ok(Self::Stats), _ => Ok(Self::Unsupported), diff --git a/relay-cogs/src/lib.rs b/relay-cogs/src/lib.rs index 68401d11eb..46c13bf46b 100644 --- a/relay-cogs/src/lib.rs +++ b/relay-cogs/src/lib.rs @@ -136,8 +136,6 @@ pub enum AppFeature { MetricsTransactions, /// Metrics in the spans namespace. MetricsSpans, - /// Metrics in the profiles namespace. - MetricsProfiles, /// Metrics in the sessions namespace. MetricsSessions, /// Metrics in the custom namespace. @@ -167,7 +165,6 @@ impl AppFeature { Self::Replays => "replays", Self::MetricsTransactions => "metrics_transactions", Self::MetricsSpans => "metrics_spans", - Self::MetricsProfiles => "metrics_profiles", Self::MetricsSessions => "metrics_sessions", Self::MetricsCustom => "metrics_custom", Self::MetricsStats => "metrics_metric_stats", diff --git a/relay-dynamic-config/src/global.rs b/relay-dynamic-config/src/global.rs index d41b607cba..8860a2dd66 100644 --- a/relay-dynamic-config/src/global.rs +++ b/relay-dynamic-config/src/global.rs @@ -249,7 +249,6 @@ impl BucketEncodings { match namespace { MetricNamespace::Transactions => self.transactions, MetricNamespace::Spans => self.spans, - MetricNamespace::Profiles => self.profiles, MetricNamespace::Custom => self.custom, MetricNamespace::Stats => self.metric_stats, // Always force the legacy encoding for sessions, diff --git a/relay-metrics/src/aggregator/cost.rs b/relay-metrics/src/aggregator/cost.rs index 8956055f87..18f05c1c09 100644 --- a/relay-metrics/src/aggregator/cost.rs +++ b/relay-metrics/src/aggregator/cost.rs @@ -145,17 +145,12 @@ mod tests { } "#); cost_tracker.add_cost(MetricNamespace::Custom, project_key1, 50); - cost_tracker.add_cost(MetricNamespace::Profiles, project_key1, 50); insta::assert_debug_snapshot!(cost_tracker, @r#" CostTracker { total_cost: 100, cost_per_project_key: { ProjectKey("a94ae32be2584e0bbd7a4cbb95971fed"): 100, }, - cost_per_namespace: { - Profiles: 50, - Custom: 50, - }, } "#); cost_tracker.add_cost(namespace, project_key2, 200); @@ -167,7 +162,6 @@ mod tests { ProjectKey("a94ae32be2584e0bbd7a4cbb95971fee"): 200, }, cost_per_namespace: { - Profiles: 50, Custom: 250, }, } @@ -182,7 +176,6 @@ mod tests { ProjectKey("a94ae32be2584e0bbd7a4cbb95971fee"): 200, }, cost_per_namespace: { - Profiles: 50, Custom: 250, }, } @@ -197,7 +190,6 @@ mod tests { ProjectKey("a94ae32be2584e0bbd7a4cbb95971fee"): 200, }, cost_per_namespace: { - Profiles: 50, Custom: 250, }, } @@ -211,14 +203,12 @@ mod tests { ProjectKey("a94ae32be2584e0bbd7a4cbb95971fee"): 180, }, cost_per_namespace: { - Profiles: 50, Custom: 230, }, } "#); // Subtract all - cost_tracker.subtract_cost(MetricNamespace::Profiles, project_key1, 50); cost_tracker.subtract_cost(MetricNamespace::Custom, project_key1, 50); cost_tracker.subtract_cost(MetricNamespace::Custom, project_key2, 180); insta::assert_debug_snapshot!(cost_tracker, @r#" diff --git a/relay-metrics/src/cogs.rs b/relay-metrics/src/cogs.rs index 29d5f2c147..c8df9d5701 100644 --- a/relay-metrics/src/cogs.rs +++ b/relay-metrics/src/cogs.rs @@ -40,7 +40,6 @@ fn to_app_feature(ns: MetricNamespace) -> AppFeature { MetricNamespace::Sessions => AppFeature::MetricsSessions, MetricNamespace::Transactions => AppFeature::MetricsTransactions, MetricNamespace::Spans => AppFeature::MetricsSpans, - MetricNamespace::Profiles => AppFeature::MetricsProfiles, MetricNamespace::Custom => AppFeature::MetricsCustom, MetricNamespace::Stats => AppFeature::MetricsStats, MetricNamespace::Unsupported => AppFeature::MetricsUnsupported, diff --git a/relay-server/src/services/processor/metrics.rs b/relay-server/src/services/processor/metrics.rs index d7669cd6bb..4a0b025aaf 100644 --- a/relay-server/src/services/processor/metrics.rs +++ b/relay-server/src/services/processor/metrics.rs @@ -18,7 +18,6 @@ pub fn is_valid_namespace(bucket: &Bucket, source: BucketSource) -> bool { MetricNamespace::Sessions => true, MetricNamespace::Transactions => true, MetricNamespace::Spans => true, - MetricNamespace::Profiles => true, MetricNamespace::Custom => true, MetricNamespace::Stats => source == BucketSource::Internal, MetricNamespace::Unsupported => false, @@ -81,7 +80,6 @@ fn is_metric_namespace_valid(state: &ProjectInfo, namespace: MetricNamespace) -> MetricNamespace::Sessions => true, MetricNamespace::Transactions => true, MetricNamespace::Spans => state.config.features.produces_spans(), - MetricNamespace::Profiles => true, MetricNamespace::Custom => state.has_feature(Feature::CustomMetrics), MetricNamespace::Stats => true, MetricNamespace::Unsupported => false, diff --git a/relay-server/src/services/store.rs b/relay-server/src/services/store.rs index d3d1f9cda3..48ec176750 100644 --- a/relay-server/src/services/store.rs +++ b/relay-server/src/services/store.rs @@ -663,17 +663,6 @@ impl StoreService { ); return Ok(()); } - MetricNamespace::Profiles => { - if !self - .global_config - .current() - .options - .profiles_function_generic_metrics_enabled - { - return Ok(()); - } - KafkaTopic::MetricsGeneric - } _ => KafkaTopic::MetricsGeneric, }; let headers = BTreeMap::from([("namespace".to_string(), namespace.to_string())]); @@ -1346,7 +1335,6 @@ impl Message for KafkaMessage<'_> { MetricNamespace::Sessions => "metric_sessions", MetricNamespace::Transactions => "metric_transactions", MetricNamespace::Spans => "metric_spans", - MetricNamespace::Profiles => "metric_profiles", MetricNamespace::Custom => "metric_custom", MetricNamespace::Stats => "metric_metric_stats", MetricNamespace::Unsupported => "metric_unsupported", diff --git a/tests/integration/test_metrics.py b/tests/integration/test_metrics.py index de6a35fc84..f2e870a94b 100644 --- a/tests/integration/test_metrics.py +++ b/tests/integration/test_metrics.py @@ -1905,44 +1905,6 @@ def test_missing_global_filters_enables_metric_extraction( assert metrics_consumer.get_metrics() -def test_profiles_metrics(mini_sentry, relay): - relay = relay(mini_sentry, options=TEST_CONFIG) - - project_id = 42 - mini_sentry.add_basic_project_config(project_id) - - timestamp = int(datetime.now(tz=timezone.utc).timestamp()) - metrics_payload = f"profiles/foo:42|c|T{timestamp}\nprofiles/bar:17|c|T{timestamp}" - - relay.send_metrics(project_id, metrics_payload) - - envelope = mini_sentry.captured_events.get(timeout=3) - assert len(envelope.items) == 1 - - metrics_item = envelope.items[0] - assert metrics_item.type == "metric_buckets" - - received_metrics = metrics_without_keys( - json.loads(metrics_item.get_bytes().decode()), keys={"metadata"} - ) - assert received_metrics == [ - { - "timestamp": time_after(timestamp), - "width": 1, - "name": "c:profiles/bar@none", - "value": 17.0, - "type": "c", - }, - { - "timestamp": time_after(timestamp), - "width": 1, - "name": "c:profiles/foo@none", - "value": 42.0, - "type": "c", - }, - ] - - def test_metrics_with_denied_names( mini_sentry, relay_with_processing, metrics_consumer ):