Skip to content

Commit c139cd3

Browse files
add profiling to Rum Events Formats
1 parent 834392d commit c139cd3

6 files changed

Lines changed: 560 additions & 2 deletions

File tree

lib/cjs/generated/rum.d.ts

Lines changed: 139 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/**
55
* Schema of all properties of a RUM event
66
*/
7-
export declare type RumEvent = RumActionEvent | RumTransitionEvent | RumErrorEvent | RumLongTaskEvent | RumResourceEvent | RumViewEvent | RumVitalEvent;
7+
export declare type RumEvent = RumActionEvent | RumTransitionEvent | RumErrorEvent | RumLongTaskEvent | RumResourceEvent | RumViewEvent | RumProfileEvent | RumVitalEvent;
88
/**
99
* Schema of all properties of an Action event
1010
*/
@@ -1238,6 +1238,144 @@ export declare type RumViewEvent = CommonProperties & ViewContainerSchema & Stre
12381238
};
12391239
[k: string]: unknown;
12401240
};
1241+
/**
1242+
* Schema of all properties of a Profile event
1243+
*/
1244+
export declare type RumProfileEvent = CommonProperties & ViewContainerSchema & {
1245+
readonly type: 'profile';
1246+
/**
1247+
* Long Task properties
1248+
*/
1249+
readonly long_task?: {
1250+
/**
1251+
* Array of long task UUIDs associated with the profile
1252+
*/
1253+
readonly id?: string[];
1254+
[k: string]: unknown;
1255+
};
1256+
/**
1257+
* Internal properties
1258+
*/
1259+
_dd?: {
1260+
profiling?: ProfilingInternalContextSchema;
1261+
[k: string]: unknown;
1262+
};
1263+
/**
1264+
* Profile properties
1265+
*/
1266+
readonly profile: {
1267+
/**
1268+
* UUID of the profile
1269+
*/
1270+
readonly id: string;
1271+
/**
1272+
* An array of profiler resources (URLs)
1273+
*/
1274+
readonly resources: string[];
1275+
/**
1276+
* An array of profiler frames
1277+
*/
1278+
readonly frames: {
1279+
/**
1280+
* A function instance name
1281+
*/
1282+
name: string;
1283+
/**
1284+
* Index in the trace.resources array
1285+
*/
1286+
resourceId?: number;
1287+
/**
1288+
* 1-based index of the line
1289+
*/
1290+
line?: number;
1291+
/**
1292+
* 1-based index of the column
1293+
*/
1294+
column?: number;
1295+
[k: string]: unknown;
1296+
}[];
1297+
/**
1298+
* An array of profiler stacks
1299+
*/
1300+
readonly stacks: {
1301+
/**
1302+
* Index in the trace.stacks array
1303+
*/
1304+
parentId?: number;
1305+
/**
1306+
* Index in the trace.frames array
1307+
*/
1308+
frameId: number;
1309+
[k: string]: unknown;
1310+
}[];
1311+
/**
1312+
* An array of profiler samples
1313+
*/
1314+
readonly samples: {
1315+
/**
1316+
* High resolution time relative to the profiling session's time origin
1317+
*/
1318+
timestamp: number;
1319+
/**
1320+
* Index in the trace.stacks array
1321+
*/
1322+
stackId?: number;
1323+
[k: string]: unknown;
1324+
}[];
1325+
/**
1326+
* Sample interval in milliseconds
1327+
*/
1328+
readonly sample_interval: number;
1329+
/**
1330+
* Maximum buffer size in number of samples
1331+
*/
1332+
readonly max_buffer_size?: number;
1333+
/**
1334+
* High resolution time when profiler trace started, relative to the profiling session's time origin
1335+
*/
1336+
readonly start_clocks: {
1337+
/**
1338+
* Relative time
1339+
*/
1340+
readonly relative: number;
1341+
/**
1342+
* Timestamp
1343+
*/
1344+
readonly time_stamp: number;
1345+
[k: string]: unknown;
1346+
};
1347+
/**
1348+
* High resolution time when profiler trace ended, relative to the profiling session's time origin
1349+
*/
1350+
readonly end_clocks: {
1351+
/**
1352+
* Relative time
1353+
*/
1354+
readonly relative: number;
1355+
/**
1356+
* Timestamp
1357+
*/
1358+
readonly time_stamp: number;
1359+
[k: string]: unknown;
1360+
};
1361+
/**
1362+
* Time origin of the profiling session
1363+
*/
1364+
readonly clocks_origin: {
1365+
/**
1366+
* Relative time
1367+
*/
1368+
readonly relative: number;
1369+
/**
1370+
* Timestamp
1371+
*/
1372+
readonly time_stamp: number;
1373+
[k: string]: unknown;
1374+
};
1375+
[k: string]: unknown;
1376+
};
1377+
[k: string]: unknown;
1378+
};
12411379
export declare type RumVitalEvent = RumVitalDurationEvent | RumVitalOperationStepEvent | RumVitalAppLaunchEvent;
12421380
/**
12431381
* Schema for a duration vital event.

lib/esm/generated/rum.d.ts

Lines changed: 139 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/**
55
* Schema of all properties of a RUM event
66
*/
7-
export declare type RumEvent = RumActionEvent | RumTransitionEvent | RumErrorEvent | RumLongTaskEvent | RumResourceEvent | RumViewEvent | RumVitalEvent;
7+
export declare type RumEvent = RumActionEvent | RumTransitionEvent | RumErrorEvent | RumLongTaskEvent | RumResourceEvent | RumViewEvent | RumProfileEvent | RumVitalEvent;
88
/**
99
* Schema of all properties of an Action event
1010
*/
@@ -1238,6 +1238,144 @@ export declare type RumViewEvent = CommonProperties & ViewContainerSchema & Stre
12381238
};
12391239
[k: string]: unknown;
12401240
};
1241+
/**
1242+
* Schema of all properties of a Profile event
1243+
*/
1244+
export declare type RumProfileEvent = CommonProperties & ViewContainerSchema & {
1245+
readonly type: 'profile';
1246+
/**
1247+
* Long Task properties
1248+
*/
1249+
readonly long_task?: {
1250+
/**
1251+
* Array of long task UUIDs associated with the profile
1252+
*/
1253+
readonly id?: string[];
1254+
[k: string]: unknown;
1255+
};
1256+
/**
1257+
* Internal properties
1258+
*/
1259+
_dd?: {
1260+
profiling?: ProfilingInternalContextSchema;
1261+
[k: string]: unknown;
1262+
};
1263+
/**
1264+
* Profile properties
1265+
*/
1266+
readonly profile: {
1267+
/**
1268+
* UUID of the profile
1269+
*/
1270+
readonly id: string;
1271+
/**
1272+
* An array of profiler resources (URLs)
1273+
*/
1274+
readonly resources: string[];
1275+
/**
1276+
* An array of profiler frames
1277+
*/
1278+
readonly frames: {
1279+
/**
1280+
* A function instance name
1281+
*/
1282+
name: string;
1283+
/**
1284+
* Index in the trace.resources array
1285+
*/
1286+
resourceId?: number;
1287+
/**
1288+
* 1-based index of the line
1289+
*/
1290+
line?: number;
1291+
/**
1292+
* 1-based index of the column
1293+
*/
1294+
column?: number;
1295+
[k: string]: unknown;
1296+
}[];
1297+
/**
1298+
* An array of profiler stacks
1299+
*/
1300+
readonly stacks: {
1301+
/**
1302+
* Index in the trace.stacks array
1303+
*/
1304+
parentId?: number;
1305+
/**
1306+
* Index in the trace.frames array
1307+
*/
1308+
frameId: number;
1309+
[k: string]: unknown;
1310+
}[];
1311+
/**
1312+
* An array of profiler samples
1313+
*/
1314+
readonly samples: {
1315+
/**
1316+
* High resolution time relative to the profiling session's time origin
1317+
*/
1318+
timestamp: number;
1319+
/**
1320+
* Index in the trace.stacks array
1321+
*/
1322+
stackId?: number;
1323+
[k: string]: unknown;
1324+
}[];
1325+
/**
1326+
* Sample interval in milliseconds
1327+
*/
1328+
readonly sample_interval: number;
1329+
/**
1330+
* Maximum buffer size in number of samples
1331+
*/
1332+
readonly max_buffer_size?: number;
1333+
/**
1334+
* High resolution time when profiler trace started, relative to the profiling session's time origin
1335+
*/
1336+
readonly start_clocks: {
1337+
/**
1338+
* Relative time
1339+
*/
1340+
readonly relative: number;
1341+
/**
1342+
* Timestamp
1343+
*/
1344+
readonly time_stamp: number;
1345+
[k: string]: unknown;
1346+
};
1347+
/**
1348+
* High resolution time when profiler trace ended, relative to the profiling session's time origin
1349+
*/
1350+
readonly end_clocks: {
1351+
/**
1352+
* Relative time
1353+
*/
1354+
readonly relative: number;
1355+
/**
1356+
* Timestamp
1357+
*/
1358+
readonly time_stamp: number;
1359+
[k: string]: unknown;
1360+
};
1361+
/**
1362+
* Time origin of the profiling session
1363+
*/
1364+
readonly clocks_origin: {
1365+
/**
1366+
* Relative time
1367+
*/
1368+
readonly relative: number;
1369+
/**
1370+
* Timestamp
1371+
*/
1372+
readonly time_stamp: number;
1373+
[k: string]: unknown;
1374+
};
1375+
[k: string]: unknown;
1376+
};
1377+
[k: string]: unknown;
1378+
};
12411379
export declare type RumVitalEvent = RumVitalDurationEvent | RumVitalOperationStepEvent | RumVitalAppLaunchEvent;
12421380
/**
12431381
* Schema for a duration vital event.

samples/rum-events/profile.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"type": "profile",
3+
"date": 1763719288234,
4+
"application": {
5+
"id": "9fa62a5b-8a7e-429d-8466-8b111a4d4693"
6+
},
7+
"session": {
8+
"id": "42702ad6-a856-4a23-b3e4-db56fc5ab883",
9+
"type": "user"
10+
},
11+
"source": "browser",
12+
"view": {
13+
"id": "35091849-4ae1-452f-86ca-5da3f34fdd19",
14+
"url": "https://example.com/page"
15+
},
16+
"profile": {
17+
"id": "3f83f7f2-b1d5-4a14-a3a5-36d3a5b9f0ab",
18+
"resources": ["https://localhost:58682/assets/index-CiZoFVPd.js"],
19+
"frames": [
20+
{
21+
"name": "R2",
22+
"resourceId": 0,
23+
"line": 1,
24+
"column": 1
25+
}
26+
],
27+
"stacks": [
28+
{
29+
"frameId": 0
30+
}
31+
],
32+
"samples": [
33+
{
34+
"timestamp": 0,
35+
"stackId": 0
36+
},
37+
{
38+
"timestamp": 10,
39+
"stackId": 0
40+
}
41+
],
42+
"sample_interval": 10,
43+
"start_clocks": {
44+
"relative": 0,
45+
"time_stamp": 1763719280000
46+
},
47+
"end_clocks": {
48+
"relative": 60000,
49+
"time_stamp": 1763719340000
50+
},
51+
"clocks_origin": {
52+
"relative": 0,
53+
"time_stamp": 1763719280000
54+
}
55+
},
56+
"long_task": {
57+
"id": ["c40cf35b-0495-4049-bf81-acf3f7578e55", "f53b3f73-b22a-4e8e-86ac-f05644026752"]
58+
},
59+
"_dd": {
60+
"format_version": 2,
61+
"profiling": {
62+
"status": "running"
63+
}
64+
}
65+
}

schemas/rum-events-browser-schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
{
2424
"$ref": "rum/view-schema.json"
2525
},
26+
{
27+
"$ref": "rum/profile-schema.json"
28+
},
2629
{
2730
"title": "RumVitalEvent",
2831
"oneOf": [

schemas/rum-events-schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
{
2424
"$ref": "rum/view-schema.json"
2525
},
26+
{
27+
"$ref": "rum/profile-schema.json"
28+
},
2629
{
2730
"title": "RumVitalEvent",
2831
"oneOf": [

0 commit comments

Comments
 (0)