Skip to content

Commit bc42a89

Browse files
Add RUM Profiler data model to rum-events-format (#325)
add profiling types add ProfileEvent and ProfileEventPayload Fixes for comments fixes for comments, add Browser and Mobile prof schema remove descriptions Merge branch 'master' into beltran.bulbarella/PROF-11903-add-profiling_2 Add vitals to mobile profiling event Fix for comments add profiling schemas remove description and readOnly from clocks state schema export profiling types run prettier allow session to be undefined, change longtask enum Modify profiling schemas to stay consistent with RUM and Session Replay. Generate profiling types. Update long task entry schema to use number for duration Expose generated profiling types Merge branch 'master' into beltran.bulbarella/PROF-11903-add-profiling_2 Fix schema titles Merge branch 'master' into beltran.bulbarella/PROF-11903-add-profiling_2 Update schemas titles Remove Payload type from profiling schemas Co-authored-by: beltran.bulbarella <beltran.bulbarella@datadoghq.com>
1 parent 814fb65 commit bc42a89

36 files changed

Lines changed: 1575 additions & 0 deletions
Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
/**
2+
* DO NOT MODIFY IT BY HAND. Run `yarn generate` instead.
3+
*/
4+
/**
5+
* Schema of Browser SDK Profiling types.
6+
*/
7+
export declare type BrowserProfiling = BrowserProfileEvent | BrowserProfilerTrace;
8+
/**
9+
* Schema of the Browser SDK Profile Event payload.
10+
*/
11+
export declare type BrowserProfileEvent = ProfileCommonProperties & {
12+
/**
13+
* Profile data format.
14+
*/
15+
readonly format: 'json';
16+
/**
17+
* Datadog internal metadata.
18+
*/
19+
readonly _dd: {
20+
/**
21+
* Clock drift value. Used by Browser SDK.
22+
*/
23+
readonly clock_drift: number;
24+
[k: string]: unknown;
25+
};
26+
[k: string]: unknown;
27+
};
28+
/**
29+
* Schema of a Profile Event metadata. Contains attributes shared by all profiles.
30+
*/
31+
export interface ProfileCommonProperties {
32+
/**
33+
* Application properties.
34+
*/
35+
readonly application: {
36+
/**
37+
* Application ID.
38+
*/
39+
readonly id: string;
40+
[k: string]: unknown;
41+
};
42+
/**
43+
* Session properties.
44+
*/
45+
readonly session?: {
46+
/**
47+
* Session ID.
48+
*/
49+
readonly id: string;
50+
[k: string]: unknown;
51+
};
52+
/**
53+
* View properties.
54+
*/
55+
readonly view?: {
56+
/**
57+
* Array of view IDs.
58+
*/
59+
readonly id: string[];
60+
/**
61+
* Array of view names.
62+
*/
63+
readonly name: string[];
64+
[k: string]: unknown;
65+
};
66+
/**
67+
* Long task properties.
68+
*/
69+
readonly long_task?: {
70+
/**
71+
* Array of long task IDs.
72+
*/
73+
readonly id: string[];
74+
[k: string]: unknown;
75+
};
76+
/**
77+
* List of attachment filenames.
78+
*/
79+
readonly attachments: string[];
80+
/**
81+
* Start time as ISO 8601 date string (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
82+
*/
83+
readonly start: string;
84+
/**
85+
* End time marking when the profile ended, as ISO 8601 date string (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
86+
*/
87+
readonly end: string;
88+
/**
89+
* Profiler family.
90+
*/
91+
readonly family: 'android' | 'chrome' | 'ios';
92+
/**
93+
* Runtime environment.
94+
*/
95+
readonly runtime: 'android' | 'chrome' | 'ios';
96+
/**
97+
* Profile ingestion event version.
98+
*/
99+
readonly version: number;
100+
/**
101+
* Comma-separated profiler tags.
102+
*/
103+
readonly tags_profiler: string;
104+
[k: string]: unknown;
105+
}
106+
/**
107+
* Schema of a RUM profiler trace containing profiling data enriched with RUM context.
108+
*/
109+
export interface BrowserProfilerTrace {
110+
/**
111+
* An array of profiler resources.
112+
*/
113+
readonly resources: string[];
114+
/**
115+
* An array of profiler frames.
116+
*/
117+
readonly frames: ProfilerFrame[];
118+
/**
119+
* An array of profiler stacks.
120+
*/
121+
readonly stacks: ProfilerStack[];
122+
/**
123+
* An array of profiler samples.
124+
*/
125+
readonly samples: ProfilerSample[];
126+
startClocks: ClocksState;
127+
endClocks: ClocksState;
128+
clocksOrigin: ClocksState;
129+
/**
130+
* Sample interval in milliseconds.
131+
*/
132+
readonly sampleInterval: number;
133+
/**
134+
* List of detected long tasks.
135+
*/
136+
readonly longTasks: RumProfilerLongTaskEntry[];
137+
/**
138+
* List of detected navigation entries.
139+
*/
140+
readonly views: RumViewEntry[];
141+
[k: string]: unknown;
142+
}
143+
/**
144+
* Schema of a profiler frame from the JS Self-Profiling API.
145+
*/
146+
export interface ProfilerFrame {
147+
/**
148+
* A function instance name.
149+
*/
150+
readonly name: string;
151+
/**
152+
* Index in the trace.resources array.
153+
*/
154+
readonly resourceId?: number;
155+
/**
156+
* 1-based index of the line.
157+
*/
158+
readonly line?: number;
159+
/**
160+
* 1-based index of the column.
161+
*/
162+
readonly column?: number;
163+
[k: string]: unknown;
164+
}
165+
/**
166+
* Schema of a profiler stack from the JS Self-Profiling API.
167+
*/
168+
export interface ProfilerStack {
169+
/**
170+
* Index in the trace.stacks array.
171+
*/
172+
readonly parentId?: number;
173+
/**
174+
* Index in the trace.frames array.
175+
*/
176+
readonly frameId: number;
177+
[k: string]: unknown;
178+
}
179+
/**
180+
* Schema of a profiler sample from the JS Self-Profiling API.
181+
*/
182+
export interface ProfilerSample {
183+
/**
184+
* High resolution time relative to the profiling session's time origin.
185+
*/
186+
readonly timestamp: number;
187+
/**
188+
* Index in the trace.stacks array.
189+
*/
190+
readonly stackId?: number;
191+
[k: string]: unknown;
192+
}
193+
/**
194+
* Schema of timing state with both relative and absolute timestamps.
195+
*/
196+
export interface ClocksState {
197+
/**
198+
* Time relative to navigation start in milliseconds.
199+
*/
200+
readonly relative: number;
201+
/**
202+
* Epoch time in milliseconds.
203+
*/
204+
readonly timeStamp: number;
205+
[k: string]: unknown;
206+
}
207+
/**
208+
* Schema of a long task entry recorded during profiling.
209+
*/
210+
export interface RumProfilerLongTaskEntry {
211+
/**
212+
* RUM Long Task id.
213+
*/
214+
readonly id?: string;
215+
/**
216+
* Duration in ns of the long task or long animation frame.
217+
*/
218+
readonly duration: number;
219+
/**
220+
* Type of the event: long task or long animation frame
221+
*/
222+
readonly entryType: 'longtask' | 'long-animation-frame';
223+
startClocks: ClocksState;
224+
[k: string]: unknown;
225+
}
226+
/**
227+
* Schema of a RUM view entry recorded during profiling.
228+
*/
229+
export interface RumViewEntry {
230+
startClocks: ClocksState;
231+
/**
232+
* RUM view id.
233+
*/
234+
readonly viewId: string;
235+
/**
236+
* RUM view name.
237+
*/
238+
readonly viewName?: string;
239+
[k: string]: unknown;
240+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"use strict";
2+
/* eslint-disable */
3+
/**
4+
* DO NOT MODIFY IT BY HAND. Run `yarn generate` instead.
5+
*/
6+
Object.defineProperty(exports, "__esModule", { value: true });
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/**
2+
* DO NOT MODIFY IT BY HAND. Run `yarn generate` instead.
3+
*/
4+
/**
5+
* Schema of the Mobile SDK Profile Event metadata.
6+
*/
7+
export declare type MobileProfileEvent = ProfileCommonProperties & {
8+
/**
9+
* The RUM Vital this profile event is associated with.
10+
*/
11+
readonly vital: {
12+
/**
13+
* Unique identifier of RUM Vital in the UUID format.
14+
*/
15+
readonly id: string;
16+
[k: string]: unknown;
17+
};
18+
[k: string]: unknown;
19+
};
20+
/**
21+
* Schema of a Profile Event metadata. Contains attributes shared by all profiles.
22+
*/
23+
export interface ProfileCommonProperties {
24+
/**
25+
* Application properties.
26+
*/
27+
readonly application: {
28+
/**
29+
* Application ID.
30+
*/
31+
readonly id: string;
32+
[k: string]: unknown;
33+
};
34+
/**
35+
* Session properties.
36+
*/
37+
readonly session?: {
38+
/**
39+
* Session ID.
40+
*/
41+
readonly id: string;
42+
[k: string]: unknown;
43+
};
44+
/**
45+
* View properties.
46+
*/
47+
readonly view?: {
48+
/**
49+
* Array of view IDs.
50+
*/
51+
readonly id: string[];
52+
/**
53+
* Array of view names.
54+
*/
55+
readonly name: string[];
56+
[k: string]: unknown;
57+
};
58+
/**
59+
* Long task properties.
60+
*/
61+
readonly long_task?: {
62+
/**
63+
* Array of long task IDs.
64+
*/
65+
readonly id: string[];
66+
[k: string]: unknown;
67+
};
68+
/**
69+
* List of attachment filenames.
70+
*/
71+
readonly attachments: string[];
72+
/**
73+
* Start time as ISO 8601 date string (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
74+
*/
75+
readonly start: string;
76+
/**
77+
* End time marking when the profile ended, as ISO 8601 date string (yyyy-MM-dd'T'HH:mm:ss.SSS'Z').
78+
*/
79+
readonly end: string;
80+
/**
81+
* Profiler family.
82+
*/
83+
readonly family: 'android' | 'chrome' | 'ios';
84+
/**
85+
* Runtime environment.
86+
*/
87+
readonly runtime: 'android' | 'chrome' | 'ios';
88+
/**
89+
* Profile ingestion event version.
90+
*/
91+
readonly version: number;
92+
/**
93+
* Comma-separated profiler tags.
94+
*/
95+
readonly tags_profiler: string;
96+
[k: string]: unknown;
97+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"use strict";
2+
/* eslint-disable */
3+
/**
4+
* DO NOT MODIFY IT BY HAND. Run `yarn generate` instead.
5+
*/
6+
Object.defineProperty(exports, "__esModule", { value: true });

0 commit comments

Comments
 (0)