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(spans): Merge feature flags for span metrics and standalone spans extraction #2447

Merged
merged 5 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
- Fixes the `TraceContext.status` not being defaulted to `unknown` before the new metrics extraction pipeline. ([#2436](https://github.com/getsentry/relay/pull/2436))
- Support on-demand metrics for alerts and widgets in external Relays. ([#2440](https://github.com/getsentry/relay/pull/2440))

**Internal**:

- Merge span metrics and standalone spans extraction options. ([#2447](https://github.com/getsentry/relay/pull/2447))

## 23.8.0

**Features**:
Expand Down
6 changes: 3 additions & 3 deletions relay-dynamic-config/src/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ pub enum Feature {
/// Enables metric extraction from spans.
#[serde(rename = "projects:span-metrics-extraction")]
SpanMetricsExtraction,
/// Extract spans from transactions and convert them to standalone spans.
#[serde(rename = "projects:extract-standalone-spans")]
ExtractStandaloneSpans,

/// Deprecated, still forwarded for older downstream Relays.
#[serde(rename = "organizations:transaction-name-mark-scrubbed-as-sanitized")]
Expand All @@ -32,6 +29,9 @@ pub enum Feature {
/// Deprecated, still forwarded for older downstream Relays.
#[serde(rename = "organizations:profiling")]
Deprecated3,
/// Deprecated, still forwarded for older downstream Relays.
#[serde(rename = "projects:extract-standalone-spans")]
Deprecated4,
/// Forward compatibility.
#[serde(other)]
Unknown,
Expand Down
2 changes: 1 addition & 1 deletion relay-server/src/actors/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2253,7 +2253,7 @@ impl EnvelopeProcessorService {
// Check feature flag.
if !state
.project_state
.has_feature(Feature::ExtractStandaloneSpans)
.has_feature(Feature::SpanMetricsExtraction)
{
return;
};
Expand Down
24 changes: 19 additions & 5 deletions tests/integration/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -1189,17 +1189,19 @@ 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:extract-standalone-spans"]
project_config["config"]["features"] = ["projects:span-metrics-extraction"]

event = make_transaction({"event_id": "cbf6960622e14a45abc1f03b2055b186"})
end = datetime.utcnow().replace(tzinfo=timezone.utc) - timedelta(seconds=1)
start = end - timedelta(milliseconds=500)
event["spans"] = [
{
"description": "GET /api/0/organizations/?member=1",
"op": "http",
"parent_span_id": "aaaaaaaaaaaaaaaa",
"span_id": "bbbbbbbbbbbbbbbb",
"start_timestamp": 1000,
"timestamp": 3000,
"start_timestamp": start.isoformat(),
"timestamp": end.isoformat(),
"trace_id": "ff62a8b040f340bda5d830223def1d81",
},
]
Expand All @@ -1213,14 +1215,25 @@ def test_spans(
"event_id": "cbf6960622e14a45abc1f03b2055b186",
"project_id": 42,
"span": {
"data": {
"description.scrubbed": "GET *",
"span.category": "http",
"span.description": "GET *",
"span.group": "37e3d9fab1ae9162",
"span.module": "http",
"span.op": "http",
"transaction": "hi",
"transaction.op": "hi",
},
"description": "GET /api/0/organizations/?member=1",
"exclusive_time": 500.0,
"is_segment": False,
"op": "http",
"parent_span_id": "aaaaaaaaaaaaaaaa",
"segment_id": "968cff94913ebb07",
"span_id": "bbbbbbbbbbbbbbbb",
"start_timestamp": 1000.0,
"timestamp": 3000.0,
"start_timestamp": start.timestamp(),
"timestamp": end.timestamp(),
"trace_id": "ff62a8b040f340bda5d830223def1d81",
},
}
Expand All @@ -1231,6 +1244,7 @@ def test_spans(
"event_id": "cbf6960622e14a45abc1f03b2055b186",
"project_id": 42,
"span": {
"exclusive_time": 2000.0,
"is_segment": True,
"op": "hi",
"segment_id": "968cff94913ebb07",
Expand Down