Skip to content

Commit f770780

Browse files
authored
feat(app-start): Add process load span to mobile span ops (#3227)
This was added to capture the system start up portion in Android and recently merged. Add the span op to start collecting metrics on this. See: getsentry/sentry-java#3159
1 parent 1d3f0cc commit f770780

File tree

4 files changed

+143
-1
lines changed

4 files changed

+143
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Introduce generic filters in global configs. ([#3161](https://github.com/getsentry/relay/pull/3161))
1313
- Individual cardinality limits can now be set into passive mode and not be enforced. ([#3199](https://github.com/getsentry/relay/pull/3199))
1414
- Enable HTTP compression for all APIs. ([#3233](https://github.com/getsentry/relay/pull/3233))
15+
- Add `process.load` span to ingested mobile span ops. ([#3227](https://github.com/getsentry/relay/pull/3227))
1516

1617

1718
**Bug Fixes**:

relay-dynamic-config/src/defaults.rs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const MOBILE_OPS: &[&str] = &[
2323
"app.*",
2424
"application.load",
2525
"contentprovider.load",
26+
"process.load",
2627
"ui.load*",
2728
];
2829

relay-server/src/metrics_extraction/event.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,17 @@ mod tests {
10921092
"data": {
10931093
"app_start_type": "cold"
10941094
}
1095+
},
1096+
{
1097+
"op": "process.load",
1098+
"description": "Process Initialization",
1099+
"span_id": "bd429c44b67a3eb2",
1100+
"start_timestamp": 1597976300.0000000,
1101+
"timestamp": 1597976303.0000000,
1102+
"trace_id": "ff62a8b040f340bda5d830223def1d81",
1103+
"data": {
1104+
"app_start_type": "cold"
1105+
}
10951106
}
10961107
]
10971108
}
@@ -1233,7 +1244,7 @@ mod tests {
12331244
.filter(|b| b.name == "c:spans/usage@none")
12341245
.collect::<Vec<_>>();
12351246

1236-
let expected_usage = 7; // We count all spans received by Relay
1247+
let expected_usage = 8; // We count all spans received by Relay
12371248
assert_eq!(usage_metrics.len(), expected_usage);
12381249
for m in usage_metrics {
12391250
assert!(m.tags.is_empty());

relay-server/src/metrics_extraction/snapshots/relay_server__metrics_extraction__event__tests__extract_span_metrics_mobile.snap

+129
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,76 @@ expression: "(&event.value().unwrap().spans, metrics)"
348348
platform: ~,
349349
other: {},
350350
},
351+
Span {
352+
timestamp: Timestamp(
353+
2020-08-21T02:18:23Z,
354+
),
355+
start_timestamp: Timestamp(
356+
2020-08-21T02:18:20Z,
357+
),
358+
exclusive_time: 3000.0,
359+
description: "Process Initialization",
360+
op: "process.load",
361+
span_id: SpanId(
362+
"bd429c44b67a3eb2",
363+
),
364+
parent_span_id: ~,
365+
trace_id: TraceId(
366+
"ff62a8b040f340bda5d830223def1d81",
367+
),
368+
segment_id: ~,
369+
is_segment: ~,
370+
status: ~,
371+
tags: ~,
372+
origin: ~,
373+
profile_id: ~,
374+
data: SpanData {
375+
app_start_type: String(
376+
"cold",
377+
),
378+
browser_name: ~,
379+
code_filepath: ~,
380+
code_lineno: ~,
381+
code_function: ~,
382+
code_namespace: ~,
383+
db_operation: ~,
384+
db_system: ~,
385+
environment: ~,
386+
http_decoded_response_content_length: ~,
387+
http_request_method: ~,
388+
http_response_content_length: ~,
389+
http_response_transfer_size: ~,
390+
resource_render_blocking_status: ~,
391+
server_address: ~,
392+
http_response_status_code: ~,
393+
thread_name: ~,
394+
transaction: ~,
395+
ui_component_name: ~,
396+
url_scheme: ~,
397+
user: ~,
398+
replay_id: ~,
399+
other: {},
400+
},
401+
sentry_tags: {
402+
"app_start_type": "cold",
403+
"device.class": "1",
404+
"mobile": "true",
405+
"op": "process.load",
406+
"os.name": "iOS",
407+
"platform": "cocoa",
408+
"release": "1.2.3",
409+
"sdk.name": "sentry.javascript.react-native",
410+
"sdk.version": "unknown",
411+
"transaction": "gEt /api/:version/users/",
412+
"transaction.method": "GET",
413+
"ttid": "ttid",
414+
},
415+
received: ~,
416+
measurements: ~,
417+
_metrics_summary: ~,
418+
platform: ~,
419+
other: {},
420+
},
351421
],
352422
[
353423
Bucket {
@@ -769,5 +839,64 @@ expression: "(&event.value().unwrap().spans, metrics)"
769839
"transaction": "gEt /api/:version/users/",
770840
},
771841
},
842+
Bucket {
843+
timestamp: UnixTimestamp(1597976303),
844+
width: 0,
845+
name: "d:spans/exclusive_time@millisecond",
846+
value: Distribution(
847+
[
848+
3000.0,
849+
],
850+
),
851+
tags: {
852+
"app_start_type": "cold",
853+
"device.class": "1",
854+
"os.name": "iOS",
855+
"release": "1.2.3",
856+
"span.op": "process.load",
857+
"transaction": "gEt /api/:version/users/",
858+
"transaction.method": "GET",
859+
"ttid": "ttid",
860+
},
861+
},
862+
Bucket {
863+
timestamp: UnixTimestamp(1597976303),
864+
width: 0,
865+
name: "d:spans/exclusive_time_light@millisecond",
866+
value: Distribution(
867+
[
868+
3000.0,
869+
],
870+
),
871+
tags: {
872+
"device.class": "1",
873+
"os.name": "iOS",
874+
"release": "1.2.3",
875+
"span.op": "process.load",
876+
},
877+
},
878+
Bucket {
879+
timestamp: UnixTimestamp(1597976303),
880+
width: 0,
881+
name: "c:spans/count_per_op@none",
882+
value: Counter(
883+
1.0,
884+
),
885+
tags: {
886+
"span.op": "process.load",
887+
},
888+
},
889+
Bucket {
890+
timestamp: UnixTimestamp(1597976303),
891+
width: 0,
892+
name: "c:spans/count_per_segment@none",
893+
value: Counter(
894+
1.0,
895+
),
896+
tags: {
897+
"release": "1.2.3",
898+
"transaction": "gEt /api/:version/users/",
899+
},
900+
},
772901
],
773902
)

0 commit comments

Comments
 (0)