diff --git a/CHANGELOG.md b/CHANGELOG.md index d5b17373dd..e14fdeef4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ - Rename the envelope item type for StatsD payloads to "statsd". ([#2470](https://github.com/getsentry/relay/pull/2470)) - Add a nanojoule unit for profile measurements. ([#2478](https://github.com/getsentry/relay/pull/2478)) - Add a timestamp field to report profile's start time on Android. ([#2486](https://github.com/getsentry/relay/pull/2486)) +- Filter span metrics extraction based on features. ([#2511](https://github.com/getsentry/relay/pull/2511)) ## 23.8.0 diff --git a/relay-dynamic-config/src/defaults.rs b/relay-dynamic-config/src/defaults.rs index 29876b91d9..671bfa8776 100644 --- a/relay-dynamic-config/src/defaults.rs +++ b/relay-dynamic-config/src/defaults.rs @@ -1,6 +1,9 @@ use relay_base_schema::data_category::DataCategory; use relay_common::glob2::LazyGlob; -use relay_sampling::condition::{EqCondition, RuleCondition}; +use relay_common::glob3::GlobPatterns; +use relay_sampling::condition::{ + AndCondition, EqCondition, GlobCondition, NotCondition, RuleCondition, +}; use serde_json::Value; use crate::feature::Feature; @@ -25,12 +28,44 @@ pub fn add_span_metrics(project_config: &mut ProjectConfig) { return; } + // Add conditions to filter spans if a specific module is enabled. + // By default, this will extract all spans. + let span_op_field_name = "span.op"; + let span_op_conditions = if project_config + .features + .has(Feature::SpanMetricsExtractionAllModules) + { + None + } else { + Some(RuleCondition::And(AndCondition { + inner: vec![ + RuleCondition::Glob(GlobCondition { + name: span_op_field_name.into(), + value: GlobPatterns::new(vec!["db*".into()]), + }), + RuleCondition::Not(NotCondition { + inner: Box::new(RuleCondition::Glob(GlobCondition { + name: span_op_field_name.into(), + value: GlobPatterns::new(vec!["db*clickhouse".into()]), + })), + }), + RuleCondition::Not(NotCondition { + inner: Box::new(RuleCondition::Eq(EqCondition { + name: span_op_field_name.into(), + value: Value::String("db.redis".into()), + options: Default::default(), + })), + }), + ], + })) + }; + config.metrics.extend([ MetricSpec { category: DataCategory::Span, mri: "d:spans/exclusive_time@millisecond".into(), field: Some("span.exclusive_time".into()), - condition: None, + condition: span_op_conditions.clone(), tags: vec![TagSpec { key: "transaction".into(), field: Some("span.data.transaction".into()), @@ -42,7 +77,7 @@ pub fn add_span_metrics(project_config: &mut ProjectConfig) { category: DataCategory::Span, mri: "d:spans/exclusive_time_light@millisecond".into(), field: Some("span.exclusive_time".into()), - condition: None, + condition: span_op_conditions, tags: Default::default(), }, ]); diff --git a/relay-dynamic-config/src/feature.rs b/relay-dynamic-config/src/feature.rs index 0cd32485fd..a31b4f7e5a 100644 --- a/relay-dynamic-config/src/feature.rs +++ b/relay-dynamic-config/src/feature.rs @@ -22,6 +22,9 @@ pub enum Feature { /// Allow ingestion of metrics in the "custom" namespace. #[serde(rename = "organizations:custom-metrics")] CustomMetrics, + /// Enable extracting spans for all modules. + #[serde(rename = "projects:span-metrics-extraction-all-modules")] + SpanMetricsExtractionAllModules, /// Deprecated, still forwarded for older downstream Relays. #[serde(rename = "organizations:transaction-name-mark-scrubbed-as-sanitized")] diff --git a/relay-server/src/actors/processor.rs b/relay-server/src/actors/processor.rs index 6fa42597c0..c0c78b7eec 100644 --- a/relay-server/src/actors/processor.rs +++ b/relay-server/src/actors/processor.rs @@ -2278,23 +2278,33 @@ impl EnvelopeProcessorService { state.managed_envelope.envelope_mut().add_item(item); }; + let all_modules_enabled = state + .project_state + .has_feature(Feature::SpanMetricsExtractionAllModules); + // Add child spans as envelope items. if let Some(child_spans) = event.spans.value() { for span in child_spans { - // HACK: clone the span to set the segment_id. This should happen - // as part of normalization once standalone spans reach wider adoption. - let mut span = span.clone(); - let Some(inner_span) = span.value_mut() else { - continue; - }; - inner_span.segment_id = transaction_span.segment_id.clone(); - inner_span.is_segment = Annotated::new(false); - add_span(span); + if let Some(inner_span) = span.value() { + // HACK: filter spans based on module until we figure out grouping. + let Some(span_op) = inner_span.op.value() else { + continue; + }; + if all_modules_enabled || span_op.starts_with("db") { + // HACK: clone the span to set the segment_id. This should happen + // as part of normalization once standalone spans reach wider adoption. + let mut new_span = inner_span.clone(); + new_span.segment_id = transaction_span.segment_id.clone(); + new_span.is_segment = Annotated::new(false); + add_span(Annotated::new(new_span)); + } + } } } - // Add transaction span as an envelope item. - add_span(transaction_span.into()); + if all_modules_enabled { + add_span(transaction_span.into()); + } } /// Computes the sampling decision on the incoming event diff --git a/relay-server/src/metrics_extraction/event.rs b/relay-server/src/metrics_extraction/event.rs index 8dfef91cf8..4e26a3baed 100644 --- a/relay-server/src/metrics_extraction/event.rs +++ b/relay-server/src/metrics_extraction/event.rs @@ -61,12 +61,413 @@ pub fn extract_metrics(event: &Event, config: &MetricExtractionConfig) -> Vec", + "op": "UI.React.Render", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bd429c44b67a3eb4", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81" + }, + { + "description": "GET http://domain.tld/hi", + "op": "http.client", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bd429c44b67a3eb4", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "data": { + "http.method": "GET" + } + }, + { + "description": "POST http://domain.tld/hi", + "op": "http.client", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bd429c44b67a3eb4", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "data": { + "http.request.method": "POST" + } + }, + { + "description": "PUT http://domain.tld/hi", + "op": "http.client", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bd429c44b67a3eb4", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "data": { + "method": "PUT" + } + }, + { + "description": "GET /hi/this/is/just/the/path", + "op": "http.client", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bd429c44b67a3eb4", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "data": { + "http.method": "GET" + } + }, + { + "description": "POST http://127.0.0.1:1234/api/hi", + "op": "http.client", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bd2eb23da2beb459", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": { + "http.method": "PoSt", + "status_code": "200" + } + }, + { + "description": "POST http://sth.subdomain.domain.tld:1234/api/hi", + "op": "http.client", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bd2eb23da2beb459", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": { + "http.method": "PoSt", + "status_code": "200" + } + }, + { + "description": "POST http://targetdomain.tld:1234/api/hi", + "op": "http.client", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bd2eb23da2beb459", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": { + "http.method": "POST", + "status_code": "200" + } + }, + { + "description": "POST http://targetdomain:1234/api/id/0987654321", + "op": "http.client", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bd2eb23da2beb459", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": { + "http.method": "POST", + "status_code": "200" + } + }, + { + "description": "POST http://sth.subdomain.domain.tld:1234/api/hi", + "op": "http.client", + "tags": { + "http.status_code": "200" + }, + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bd2eb23da2beb459", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": { + "http.method": "POST" + } + }, + { + "description": "POST http://sth.subdomain.domain.tld:1234/api/hi", + "op": "http.client", + "tags": { + "http.status_code": "200" + }, + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bd2eb23da2beb459", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": { + "http.method": "POST", + "status_code": "200" + } + }, + { + "description": "SeLeCt column FROM tAbLe WHERE id IN (1, 2, 3)", + "op": "db.sql.query", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bb7af8b99e95af5f", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": { + "db.system": "postgresql", + "db.operation": "SELECT" + } + }, + { + "description": "select column FROM table WHERE id IN (1, 2, 3)", + "op": "db", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bb7af8b99e95af5f", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok" + }, + { + "description": "INSERT INTO table (col) VALUES (val)", + "op": "db.sql.query", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bb7af8b99e95af5f", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": { + "db.system": "postgresql", + "db.operation": "INSERT" + } + }, + { + "description": "INSERT INTO from_date (col) VALUES (val)", + "op": "db.sql.query", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bb7af8b99e95af5f", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": { + "db.system": "postgresql", + "db.operation": "INSERT" + } + }, + { + "description": "INSERT INTO table (col) VALUES (val)", + "op": "db", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bb7af8b99e95af5f", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok" + }, + { + "description": "SELECT\n*\nFROM\ntable\nWHERE\nid\nIN\n(val)", + "op": "db.sql.query", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bb7af8b99e95af5f", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": { + "db.system": "postgresql", + "db.operation": "SELECT" + } + }, + { + "description": "SELECT \"table\".\"col\" FROM \"table\" WHERE \"table\".\"col\" = %s", + "op": "db", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bb7af8b99e95af5f", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": { + "db.system": "postgresql", + "db.operation": "SELECT" + } + }, + { + "description": "DELETE FROM table WHERE conditions", + "op": "db", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bb7af8b99e95af5f", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": { + "db.system": "MyDatabase" + } + }, + { + "description": "UPDATE table WHERE conditions", + "op": "db", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bb7af8b99e95af5f", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": { + "db.system": "MyDatabase" + } + }, + { + "description": "SAVEPOINT save_this_one", + "op": "db", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bb7af8b99e95af5f", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": { + "db.system": "MyDatabase" + } + }, + { + "description": "GET cache:user:{123}", + "op": "cache.get_item", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bb7af8b99e95af5f", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": { + "cache.hit": false + } + }, + { + "description": "GET test:123:def", + "op": "db.redis", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bb7af8b99e95af5f", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": {} + }, + { + "description": "GET lkjasdlkasjdlasjdlkasjdlkasjd", + "op": "db.redis", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bb7af8b99e95af5f", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": {} + }, + { + "description": "SET 'aaa:bbb:123:zzz' '{\"from json\": \"no\"}'", + "op": "db.redis", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bb7af8b99e95af5f", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok", + "data": {} + }, + { + "description": "http://domain/static/myscript-v1.9.23.js", + "op": "resource.script", + "parent_span_id": "8f5a2b8768cafb4e", + "span_id": "bb7af8b99e95af5f", + "start_timestamp": 1597976300.0000000, + "timestamp": 1597976302.0000000, + "trace_id": "ff62a8b040f340bda5d830223def1d81", + "status": "ok" + } + + ] + } + "#; + + let mut event = Annotated::from_json(json).unwrap(); + let features = FeatureSet(BTreeSet::from([ + Feature::SpanMetricsExtraction, + Feature::SpanMetricsExtractionAllModules, + ])); + + // Normalize first, to make sure that all things are correct as in the real pipeline: + relay_event_normalization::light_normalize_event( + &mut event, + LightNormalizationConfig { + enrich_spans: true, + light_normalize_spans: true, + ..Default::default() + }, + ) + .unwrap(); + + // Create a project config with the relevant feature flag. Sanitize to fill defaults. + let mut project = ProjectConfig { + features, + ..ProjectConfig::default() + }; + project.sanitize(); + + let config = project.metric_extraction.ok().unwrap(); + let metrics = extract_metrics(event.value().unwrap(), &config); + insta::assert_debug_snapshot!(metrics); + } + #[test] fn test_extract_span_metrics() { let json = r#" @@ -439,6 +840,7 @@ mod tests { "#; let mut event = Annotated::from_json(json).unwrap(); + let features = FeatureSet(BTreeSet::from([Feature::SpanMetricsExtraction])); // Normalize first, to make sure that all things are correct as in the real pipeline: relay_event_normalization::light_normalize_event( @@ -453,7 +855,7 @@ mod tests { // Create a project config with the relevant feature flag. Sanitize to fill defaults. let mut project = ProjectConfig { - features: [Feature::SpanMetricsExtraction].into_iter().collect(), + features, ..ProjectConfig::default() }; project.sanitize(); @@ -511,7 +913,12 @@ mod tests { // Create a project config with the relevant feature flag. Sanitize to fill defaults. let mut project = ProjectConfig { - features: [Feature::SpanMetricsExtraction].into_iter().collect(), + features: [ + Feature::SpanMetricsExtraction, + Feature::SpanMetricsExtractionAllModules, + ] + .into_iter() + .collect(), ..ProjectConfig::default() }; project.sanitize(); diff --git a/relay-server/src/metrics_extraction/snapshots/relay_server__metrics_extraction__event__tests__extract_span_metrics.snap b/relay-server/src/metrics_extraction/snapshots/relay_server__metrics_extraction__event__tests__extract_span_metrics.snap index 24e27daca6..dcf3877b09 100644 --- a/relay-server/src/metrics_extraction/snapshots/relay_server__metrics_extraction__event__tests__extract_span_metrics.snap +++ b/relay-server/src/metrics_extraction/snapshots/relay_server__metrics_extraction__event__tests__extract_span_metrics.snap @@ -3,533 +3,6 @@ source: relay-server/src/metrics_extraction/event.rs expression: metrics --- [ - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.category": "ui.react", - "span.op": "ui.react.render", - "transaction": "gEt /api/:version/users/", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time_light@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.category": "ui.react", - "span.op": "ui.react.render", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "GET", - "span.category": "http", - "span.description": "GET http://domain.tld", - "span.domain": "domain.tld", - "span.group": "d9dc18637d441612", - "span.module": "http", - "span.op": "http.client", - "transaction": "gEt /api/:version/users/", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time_light@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "GET", - "span.category": "http", - "span.description": "GET http://domain.tld", - "span.domain": "domain.tld", - "span.group": "d9dc18637d441612", - "span.module": "http", - "span.op": "http.client", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "POST", - "span.category": "http", - "span.description": "POST http://domain.tld", - "span.domain": "domain.tld", - "span.group": "25faf23529f71d3e", - "span.module": "http", - "span.op": "http.client", - "transaction": "gEt /api/:version/users/", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time_light@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "POST", - "span.category": "http", - "span.description": "POST http://domain.tld", - "span.domain": "domain.tld", - "span.group": "25faf23529f71d3e", - "span.module": "http", - "span.op": "http.client", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "PUT", - "span.category": "http", - "span.description": "PUT http://domain.tld", - "span.domain": "domain.tld", - "span.group": "488f09b46e5978be", - "span.module": "http", - "span.op": "http.client", - "transaction": "gEt /api/:version/users/", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time_light@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "PUT", - "span.category": "http", - "span.description": "PUT http://domain.tld", - "span.domain": "domain.tld", - "span.group": "488f09b46e5978be", - "span.module": "http", - "span.op": "http.client", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "GET", - "span.category": "http", - "span.description": "GET *", - "span.group": "37e3d9fab1ae9162", - "span.module": "http", - "span.op": "http.client", - "transaction": "gEt /api/:version/users/", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time_light@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "GET", - "span.category": "http", - "span.description": "GET *", - "span.group": "37e3d9fab1ae9162", - "span.module": "http", - "span.op": "http.client", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "POST", - "span.category": "http", - "span.description": "POST http://127.0.0.1:1234", - "span.group": "464fe695f9cf639c", - "span.module": "http", - "span.op": "http.client", - "span.status": "ok", - "span.status_code": "200", - "transaction": "gEt /api/:version/users/", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time_light@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "POST", - "span.category": "http", - "span.description": "POST http://127.0.0.1:1234", - "span.group": "464fe695f9cf639c", - "span.module": "http", - "span.op": "http.client", - "span.status": "ok", - "span.status_code": "200", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "POST", - "span.category": "http", - "span.description": "POST http://*.domain.tld:1234", - "span.domain": "*.domain.tld:1234", - "span.group": "86818d1c74ecfc66", - "span.module": "http", - "span.op": "http.client", - "span.status": "ok", - "span.status_code": "200", - "transaction": "gEt /api/:version/users/", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time_light@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "POST", - "span.category": "http", - "span.description": "POST http://*.domain.tld:1234", - "span.domain": "*.domain.tld:1234", - "span.group": "86818d1c74ecfc66", - "span.module": "http", - "span.op": "http.client", - "span.status": "ok", - "span.status_code": "200", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "POST", - "span.category": "http", - "span.description": "POST http://targetdomain.tld:1234", - "span.domain": "targetdomain.tld:1234", - "span.group": "72ab88b506cb04b2", - "span.module": "http", - "span.op": "http.client", - "span.status": "ok", - "span.status_code": "200", - "transaction": "gEt /api/:version/users/", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time_light@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "POST", - "span.category": "http", - "span.description": "POST http://targetdomain.tld:1234", - "span.domain": "targetdomain.tld:1234", - "span.group": "72ab88b506cb04b2", - "span.module": "http", - "span.op": "http.client", - "span.status": "ok", - "span.status_code": "200", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "POST", - "span.category": "http", - "span.description": "POST http://targetdomain:1234", - "span.domain": "targetdomain:1234", - "span.group": "c8e531abe96ff360", - "span.module": "http", - "span.op": "http.client", - "span.status": "ok", - "span.status_code": "200", - "transaction": "gEt /api/:version/users/", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time_light@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "POST", - "span.category": "http", - "span.description": "POST http://targetdomain:1234", - "span.domain": "targetdomain:1234", - "span.group": "c8e531abe96ff360", - "span.module": "http", - "span.op": "http.client", - "span.status": "ok", - "span.status_code": "200", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "POST", - "span.category": "http", - "span.description": "POST http://*.domain.tld:1234", - "span.domain": "*.domain.tld:1234", - "span.group": "86818d1c74ecfc66", - "span.module": "http", - "span.op": "http.client", - "span.status": "ok", - "span.status_code": "200", - "transaction": "gEt /api/:version/users/", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time_light@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "POST", - "span.category": "http", - "span.description": "POST http://*.domain.tld:1234", - "span.domain": "*.domain.tld:1234", - "span.group": "86818d1c74ecfc66", - "span.module": "http", - "span.op": "http.client", - "span.status": "ok", - "span.status_code": "200", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "POST", - "span.category": "http", - "span.description": "POST http://*.domain.tld:1234", - "span.domain": "*.domain.tld:1234", - "span.group": "86818d1c74ecfc66", - "span.module": "http", - "span.op": "http.client", - "span.status": "ok", - "span.status_code": "200", - "transaction": "gEt /api/:version/users/", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time_light@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "POST", - "span.category": "http", - "span.description": "POST http://*.domain.tld:1234", - "span.domain": "*.domain.tld:1234", - "span.group": "86818d1c74ecfc66", - "span.module": "http", - "span.op": "http.client", - "span.status": "ok", - "span.status_code": "200", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, Bucket { timestamp: UnixTimestamp(1597976302), width: 0, @@ -1018,233 +491,4 @@ expression: metrics "transaction.op": "myop", }, }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.category": "cache", - "span.description": "GET *", - "span.group": "37e3d9fab1ae9162", - "span.module": "cache", - "span.op": "cache.get_item", - "span.status": "ok", - "transaction": "gEt /api/:version/users/", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time_light@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.category": "cache", - "span.description": "GET *", - "span.group": "37e3d9fab1ae9162", - "span.module": "cache", - "span.op": "cache.get_item", - "span.status": "ok", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "GET", - "span.category": "db", - "span.description": "GET *", - "span.group": "37e3d9fab1ae9162", - "span.module": "db", - "span.op": "db.redis", - "span.status": "ok", - "transaction": "gEt /api/:version/users/", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time_light@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "GET", - "span.category": "db", - "span.description": "GET *", - "span.group": "37e3d9fab1ae9162", - "span.module": "db", - "span.op": "db.redis", - "span.status": "ok", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "GET", - "span.category": "db", - "span.description": "GET *", - "span.group": "37e3d9fab1ae9162", - "span.module": "db", - "span.op": "db.redis", - "span.status": "ok", - "transaction": "gEt /api/:version/users/", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time_light@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "GET", - "span.category": "db", - "span.description": "GET *", - "span.group": "37e3d9fab1ae9162", - "span.module": "db", - "span.op": "db.redis", - "span.status": "ok", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "SET", - "span.category": "db", - "span.description": "SET *", - "span.group": "46b2cac4b418f556", - "span.module": "db", - "span.op": "db.redis", - "span.status": "ok", - "transaction": "gEt /api/:version/users/", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time_light@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.action": "SET", - "span.category": "db", - "span.description": "SET *", - "span.group": "46b2cac4b418f556", - "span.module": "db", - "span.op": "db.redis", - "span.status": "ok", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.category": "resource", - "span.description": "http://domain/static/myscript-*.js", - "span.group": "022f81fdf31228bf", - "span.op": "resource.script", - "span.status": "ok", - "transaction": "gEt /api/:version/users/", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, - Bucket { - timestamp: UnixTimestamp(1597976302), - width: 0, - name: "d:spans/exclusive_time_light@millisecond", - value: Distribution( - [ - 2000.0, - ], - ), - tags: { - "environment": "fake_environment", - "http.status_code": "500", - "span.category": "resource", - "span.description": "http://domain/static/myscript-*.js", - "span.group": "022f81fdf31228bf", - "span.op": "resource.script", - "span.status": "ok", - "transaction.method": "POST", - "transaction.op": "myop", - }, - }, ] diff --git a/relay-server/src/metrics_extraction/snapshots/relay_server__metrics_extraction__event__tests__extract_span_metrics_all_modules.snap b/relay-server/src/metrics_extraction/snapshots/relay_server__metrics_extraction__event__tests__extract_span_metrics_all_modules.snap new file mode 100644 index 0000000000..24e27daca6 --- /dev/null +++ b/relay-server/src/metrics_extraction/snapshots/relay_server__metrics_extraction__event__tests__extract_span_metrics_all_modules.snap @@ -0,0 +1,1250 @@ +--- +source: relay-server/src/metrics_extraction/event.rs +expression: metrics +--- +[ + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.category": "ui.react", + "span.op": "ui.react.render", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.category": "ui.react", + "span.op": "ui.react.render", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "GET", + "span.category": "http", + "span.description": "GET http://domain.tld", + "span.domain": "domain.tld", + "span.group": "d9dc18637d441612", + "span.module": "http", + "span.op": "http.client", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "GET", + "span.category": "http", + "span.description": "GET http://domain.tld", + "span.domain": "domain.tld", + "span.group": "d9dc18637d441612", + "span.module": "http", + "span.op": "http.client", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "POST", + "span.category": "http", + "span.description": "POST http://domain.tld", + "span.domain": "domain.tld", + "span.group": "25faf23529f71d3e", + "span.module": "http", + "span.op": "http.client", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "POST", + "span.category": "http", + "span.description": "POST http://domain.tld", + "span.domain": "domain.tld", + "span.group": "25faf23529f71d3e", + "span.module": "http", + "span.op": "http.client", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "PUT", + "span.category": "http", + "span.description": "PUT http://domain.tld", + "span.domain": "domain.tld", + "span.group": "488f09b46e5978be", + "span.module": "http", + "span.op": "http.client", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "PUT", + "span.category": "http", + "span.description": "PUT http://domain.tld", + "span.domain": "domain.tld", + "span.group": "488f09b46e5978be", + "span.module": "http", + "span.op": "http.client", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "GET", + "span.category": "http", + "span.description": "GET *", + "span.group": "37e3d9fab1ae9162", + "span.module": "http", + "span.op": "http.client", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "GET", + "span.category": "http", + "span.description": "GET *", + "span.group": "37e3d9fab1ae9162", + "span.module": "http", + "span.op": "http.client", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "POST", + "span.category": "http", + "span.description": "POST http://127.0.0.1:1234", + "span.group": "464fe695f9cf639c", + "span.module": "http", + "span.op": "http.client", + "span.status": "ok", + "span.status_code": "200", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "POST", + "span.category": "http", + "span.description": "POST http://127.0.0.1:1234", + "span.group": "464fe695f9cf639c", + "span.module": "http", + "span.op": "http.client", + "span.status": "ok", + "span.status_code": "200", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "POST", + "span.category": "http", + "span.description": "POST http://*.domain.tld:1234", + "span.domain": "*.domain.tld:1234", + "span.group": "86818d1c74ecfc66", + "span.module": "http", + "span.op": "http.client", + "span.status": "ok", + "span.status_code": "200", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "POST", + "span.category": "http", + "span.description": "POST http://*.domain.tld:1234", + "span.domain": "*.domain.tld:1234", + "span.group": "86818d1c74ecfc66", + "span.module": "http", + "span.op": "http.client", + "span.status": "ok", + "span.status_code": "200", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "POST", + "span.category": "http", + "span.description": "POST http://targetdomain.tld:1234", + "span.domain": "targetdomain.tld:1234", + "span.group": "72ab88b506cb04b2", + "span.module": "http", + "span.op": "http.client", + "span.status": "ok", + "span.status_code": "200", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "POST", + "span.category": "http", + "span.description": "POST http://targetdomain.tld:1234", + "span.domain": "targetdomain.tld:1234", + "span.group": "72ab88b506cb04b2", + "span.module": "http", + "span.op": "http.client", + "span.status": "ok", + "span.status_code": "200", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "POST", + "span.category": "http", + "span.description": "POST http://targetdomain:1234", + "span.domain": "targetdomain:1234", + "span.group": "c8e531abe96ff360", + "span.module": "http", + "span.op": "http.client", + "span.status": "ok", + "span.status_code": "200", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "POST", + "span.category": "http", + "span.description": "POST http://targetdomain:1234", + "span.domain": "targetdomain:1234", + "span.group": "c8e531abe96ff360", + "span.module": "http", + "span.op": "http.client", + "span.status": "ok", + "span.status_code": "200", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "POST", + "span.category": "http", + "span.description": "POST http://*.domain.tld:1234", + "span.domain": "*.domain.tld:1234", + "span.group": "86818d1c74ecfc66", + "span.module": "http", + "span.op": "http.client", + "span.status": "ok", + "span.status_code": "200", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "POST", + "span.category": "http", + "span.description": "POST http://*.domain.tld:1234", + "span.domain": "*.domain.tld:1234", + "span.group": "86818d1c74ecfc66", + "span.module": "http", + "span.op": "http.client", + "span.status": "ok", + "span.status_code": "200", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "POST", + "span.category": "http", + "span.description": "POST http://*.domain.tld:1234", + "span.domain": "*.domain.tld:1234", + "span.group": "86818d1c74ecfc66", + "span.module": "http", + "span.op": "http.client", + "span.status": "ok", + "span.status_code": "200", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "POST", + "span.category": "http", + "span.description": "POST http://*.domain.tld:1234", + "span.domain": "*.domain.tld:1234", + "span.group": "86818d1c74ecfc66", + "span.module": "http", + "span.op": "http.client", + "span.status": "ok", + "span.status_code": "200", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "SELECT", + "span.category": "db", + "span.description": "SeLeCt column FROM tAbLe WHERE id IN (%s)", + "span.domain": "table", + "span.group": "f4a7fef06db3d88e", + "span.module": "db", + "span.op": "db.sql.query", + "span.status": "ok", + "span.system": "postgresql", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "SELECT", + "span.category": "db", + "span.description": "SeLeCt column FROM tAbLe WHERE id IN (%s)", + "span.domain": "table", + "span.group": "f4a7fef06db3d88e", + "span.module": "db", + "span.op": "db.sql.query", + "span.status": "ok", + "span.system": "postgresql", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "SELECT", + "span.category": "db", + "span.description": "select column FROM table WHERE id IN (%s)", + "span.domain": "table", + "span.group": "4f9711d2d09963b9", + "span.module": "db", + "span.op": "db", + "span.status": "ok", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "SELECT", + "span.category": "db", + "span.description": "select column FROM table WHERE id IN (%s)", + "span.domain": "table", + "span.group": "4f9711d2d09963b9", + "span.module": "db", + "span.op": "db", + "span.status": "ok", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "INSERT", + "span.category": "db", + "span.domain": "table", + "span.module": "db", + "span.op": "db.sql.query", + "span.status": "ok", + "span.system": "postgresql", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "INSERT", + "span.category": "db", + "span.domain": "table", + "span.module": "db", + "span.op": "db.sql.query", + "span.status": "ok", + "span.system": "postgresql", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "INSERT", + "span.category": "db", + "span.description": "INSERT INTO from_date (..) VALUES (%s)", + "span.domain": "from_date", + "span.group": "e4ea457c8e7e4109", + "span.module": "db", + "span.op": "db.sql.query", + "span.status": "ok", + "span.system": "postgresql", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "INSERT", + "span.category": "db", + "span.description": "INSERT INTO from_date (..) VALUES (%s)", + "span.domain": "from_date", + "span.group": "e4ea457c8e7e4109", + "span.module": "db", + "span.op": "db.sql.query", + "span.status": "ok", + "span.system": "postgresql", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "INSERT", + "span.category": "db", + "span.domain": "table", + "span.module": "db", + "span.op": "db", + "span.status": "ok", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "INSERT", + "span.category": "db", + "span.domain": "table", + "span.module": "db", + "span.op": "db", + "span.status": "ok", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "SELECT", + "span.category": "db", + "span.description": "SELECT * FROM table WHERE id IN (val)", + "span.domain": "table", + "span.group": "03cb381cee3f1463", + "span.module": "db", + "span.op": "db.sql.query", + "span.status": "ok", + "span.system": "postgresql", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "SELECT", + "span.category": "db", + "span.description": "SELECT * FROM table WHERE id IN (val)", + "span.domain": "table", + "span.group": "03cb381cee3f1463", + "span.module": "db", + "span.op": "db.sql.query", + "span.status": "ok", + "span.system": "postgresql", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "SELECT", + "span.category": "db", + "span.description": "SELECT col FROM table WHERE col = %s", + "span.domain": "table", + "span.group": "e0f7e81a59b030ba", + "span.module": "db", + "span.op": "db", + "span.status": "ok", + "span.system": "postgresql", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "SELECT", + "span.category": "db", + "span.description": "SELECT col FROM table WHERE col = %s", + "span.domain": "table", + "span.group": "e0f7e81a59b030ba", + "span.module": "db", + "span.op": "db", + "span.status": "ok", + "span.system": "postgresql", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "DELETE", + "span.category": "db", + "span.domain": "table", + "span.module": "db", + "span.op": "db", + "span.status": "ok", + "span.system": "mydatabase", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "DELETE", + "span.category": "db", + "span.domain": "table", + "span.module": "db", + "span.op": "db", + "span.status": "ok", + "span.system": "mydatabase", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "UPDATE", + "span.category": "db", + "span.domain": "table", + "span.module": "db", + "span.op": "db", + "span.status": "ok", + "span.system": "mydatabase", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "UPDATE", + "span.category": "db", + "span.domain": "table", + "span.module": "db", + "span.op": "db", + "span.status": "ok", + "span.system": "mydatabase", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "SAVEPOINT", + "span.category": "db", + "span.description": "SAVEPOINT %s", + "span.group": "3f955cbde39e04b9", + "span.module": "db", + "span.op": "db", + "span.status": "ok", + "span.system": "mydatabase", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "SAVEPOINT", + "span.category": "db", + "span.description": "SAVEPOINT %s", + "span.group": "3f955cbde39e04b9", + "span.module": "db", + "span.op": "db", + "span.status": "ok", + "span.system": "mydatabase", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.category": "cache", + "span.description": "GET *", + "span.group": "37e3d9fab1ae9162", + "span.module": "cache", + "span.op": "cache.get_item", + "span.status": "ok", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.category": "cache", + "span.description": "GET *", + "span.group": "37e3d9fab1ae9162", + "span.module": "cache", + "span.op": "cache.get_item", + "span.status": "ok", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "GET", + "span.category": "db", + "span.description": "GET *", + "span.group": "37e3d9fab1ae9162", + "span.module": "db", + "span.op": "db.redis", + "span.status": "ok", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "GET", + "span.category": "db", + "span.description": "GET *", + "span.group": "37e3d9fab1ae9162", + "span.module": "db", + "span.op": "db.redis", + "span.status": "ok", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "GET", + "span.category": "db", + "span.description": "GET *", + "span.group": "37e3d9fab1ae9162", + "span.module": "db", + "span.op": "db.redis", + "span.status": "ok", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "GET", + "span.category": "db", + "span.description": "GET *", + "span.group": "37e3d9fab1ae9162", + "span.module": "db", + "span.op": "db.redis", + "span.status": "ok", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "SET", + "span.category": "db", + "span.description": "SET *", + "span.group": "46b2cac4b418f556", + "span.module": "db", + "span.op": "db.redis", + "span.status": "ok", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.action": "SET", + "span.category": "db", + "span.description": "SET *", + "span.group": "46b2cac4b418f556", + "span.module": "db", + "span.op": "db.redis", + "span.status": "ok", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.category": "resource", + "span.description": "http://domain/static/myscript-*.js", + "span.group": "022f81fdf31228bf", + "span.op": "resource.script", + "span.status": "ok", + "transaction": "gEt /api/:version/users/", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, + Bucket { + timestamp: UnixTimestamp(1597976302), + width: 0, + name: "d:spans/exclusive_time_light@millisecond", + value: Distribution( + [ + 2000.0, + ], + ), + tags: { + "environment": "fake_environment", + "http.status_code": "500", + "span.category": "resource", + "span.description": "http://domain/static/myscript-*.js", + "span.group": "022f81fdf31228bf", + "span.op": "resource.script", + "span.status": "ok", + "transaction.method": "POST", + "transaction.op": "myop", + }, + }, +] diff --git a/tests/integration/test_store.py b/tests/integration/test_store.py index 42f8ee5562..f8e63b447e 100644 --- a/tests/integration/test_store.py +++ b/tests/integration/test_store.py @@ -1189,7 +1189,10 @@ def test_spans( relay = relay_with_processing() project_id = 42 project_config = mini_sentry.add_basic_project_config(project_id) - project_config["config"]["features"] = ["projects:span-metrics-extraction"] + project_config["config"]["features"] = [ + "projects:span-metrics-extraction", + "projects:span-metrics-extraction-all-modules", + ] event = make_transaction({"event_id": "cbf6960622e14a45abc1f03b2055b186"}) end = datetime.utcnow().replace(tzinfo=timezone.utc) - timedelta(seconds=1)