diff --git a/lib/cjs/generated/rum.d.ts b/lib/cjs/generated/rum.d.ts index 8e5518b8..1fb7e27f 100644 --- a/lib/cjs/generated/rum.d.ts +++ b/lib/cjs/generated/rum.d.ts @@ -4,7 +4,7 @@ /** * Schema of all properties of a RUM event */ -export type RumEvent = RumActionEvent | RumTransitionEvent | RumErrorEvent | RumLongTaskEvent | RumResourceEvent | RumViewEvent | RumViewUpdateEvent | RumVitalEvent; +export type RumEvent = RumActionEvent | RumTransitionEvent | RumErrorEvent | RumLongTaskEvent | RumResourceEvent | RumViewEvent | RumViewUpdateEvent | RumProcessEvent | RumVitalEvent; /** * Schema of all properties of an Action event */ @@ -879,6 +879,60 @@ export type RumViewUpdateEvent = ViewContainerSchema & StreamSchema & ViewProper readonly type: 'view_update'; [k: string]: unknown; }; +/** + * Schema of all properties of a Process event + */ +export type RumProcessEvent = CommonProperties & { + /** + * RUM event type + */ + readonly type: 'process'; + /** + * Process properties + */ + readonly process: { + /** + * UUID of the process + */ + readonly id: string; + /** + * Role of the process + */ + readonly role: 'main' | 'renderer' | 'utility'; + /** + * OS process ID + */ + readonly pid: number; + /** + * Parent OS process ID + */ + readonly ppid?: number; + /** + * Process name + */ + readonly name?: string; + /** + * Process lifetime in nanoseconds + */ + readonly duration?: number; + /** + * Reason for process exit + */ + readonly exit_reason?: 'clean-exit' | 'abnormal-exit' | 'killed' | 'crashed' | 'oom' | 'launch-failed' | 'integrity-failure' | 'memory-eviction'; + [k: string]: unknown; + }; + /** + * Internal properties + */ + readonly _dd: { + /** + * Version of the update of the process event + */ + readonly document_version: number; + [k: string]: unknown; + }; + [k: string]: unknown; +}; export type RumVitalEvent = RumVitalDurationEvent | RumVitalOperationStepEvent | RumVitalAppLaunchEvent; /** * Schema for a duration vital event. @@ -1086,6 +1140,10 @@ export interface CommonProperties { * User defined name of the view */ name?: string; + /** + * Whether this view was synthetically created to carry view-less events + */ + readonly is_fake?: boolean; [k: string]: unknown; }; /** @@ -1368,6 +1426,24 @@ export interface CommonProperties { readonly id: string; [k: string]: unknown; }; + /** + * Process properties + */ + readonly process?: { + /** + * UUID of the process + */ + readonly id?: string; + /** + * Role of the process + */ + readonly role?: 'main' | 'renderer' | 'utility'; + /** + * Process name + */ + readonly name?: string; + [k: string]: unknown; + }; [k: string]: unknown; } /** diff --git a/lib/esm/generated/rum.d.ts b/lib/esm/generated/rum.d.ts index 8e5518b8..1fb7e27f 100644 --- a/lib/esm/generated/rum.d.ts +++ b/lib/esm/generated/rum.d.ts @@ -4,7 +4,7 @@ /** * Schema of all properties of a RUM event */ -export type RumEvent = RumActionEvent | RumTransitionEvent | RumErrorEvent | RumLongTaskEvent | RumResourceEvent | RumViewEvent | RumViewUpdateEvent | RumVitalEvent; +export type RumEvent = RumActionEvent | RumTransitionEvent | RumErrorEvent | RumLongTaskEvent | RumResourceEvent | RumViewEvent | RumViewUpdateEvent | RumProcessEvent | RumVitalEvent; /** * Schema of all properties of an Action event */ @@ -879,6 +879,60 @@ export type RumViewUpdateEvent = ViewContainerSchema & StreamSchema & ViewProper readonly type: 'view_update'; [k: string]: unknown; }; +/** + * Schema of all properties of a Process event + */ +export type RumProcessEvent = CommonProperties & { + /** + * RUM event type + */ + readonly type: 'process'; + /** + * Process properties + */ + readonly process: { + /** + * UUID of the process + */ + readonly id: string; + /** + * Role of the process + */ + readonly role: 'main' | 'renderer' | 'utility'; + /** + * OS process ID + */ + readonly pid: number; + /** + * Parent OS process ID + */ + readonly ppid?: number; + /** + * Process name + */ + readonly name?: string; + /** + * Process lifetime in nanoseconds + */ + readonly duration?: number; + /** + * Reason for process exit + */ + readonly exit_reason?: 'clean-exit' | 'abnormal-exit' | 'killed' | 'crashed' | 'oom' | 'launch-failed' | 'integrity-failure' | 'memory-eviction'; + [k: string]: unknown; + }; + /** + * Internal properties + */ + readonly _dd: { + /** + * Version of the update of the process event + */ + readonly document_version: number; + [k: string]: unknown; + }; + [k: string]: unknown; +}; export type RumVitalEvent = RumVitalDurationEvent | RumVitalOperationStepEvent | RumVitalAppLaunchEvent; /** * Schema for a duration vital event. @@ -1086,6 +1140,10 @@ export interface CommonProperties { * User defined name of the view */ name?: string; + /** + * Whether this view was synthetically created to carry view-less events + */ + readonly is_fake?: boolean; [k: string]: unknown; }; /** @@ -1368,6 +1426,24 @@ export interface CommonProperties { readonly id: string; [k: string]: unknown; }; + /** + * Process properties + */ + readonly process?: { + /** + * UUID of the process + */ + readonly id?: string; + /** + * Role of the process + */ + readonly role?: 'main' | 'renderer' | 'utility'; + /** + * Process name + */ + readonly name?: string; + [k: string]: unknown; + }; [k: string]: unknown; } /** diff --git a/samples/rum-events/process.json b/samples/rum-events/process.json new file mode 100644 index 00000000..6be40418 --- /dev/null +++ b/samples/rum-events/process.json @@ -0,0 +1,30 @@ +{ + "type": "process", + "date": 1591284428705, + "application": { + "id": "ac8218cf-498b-4d33-bd44-151095959547" + }, + "session": { + "id": "cacbf45c-3a05-48ce-b066-d76349460599", + "type": "user" + }, + "view": { + "id": "cacbf45c-3a05-48ce-b066-d76349460599", + "url": "electron://fake", + "is_fake": true + }, + "source": "electron", + "process": { + "id": "b1a2c3d4-e5f6-7890-abcd-ef1234567890", + "role": "renderer", + "pid": 1236, + "ppid": 1234, + "name": "renderer", + "duration": 220000000000, + "exit_reason": "clean-exit" + }, + "_dd": { + "format_version": 2, + "document_version": 1 + } +} diff --git a/schemas/rum-events-schema.json b/schemas/rum-events-schema.json index fdd4757f..fb2b4cc0 100644 --- a/schemas/rum-events-schema.json +++ b/schemas/rum-events-schema.json @@ -26,6 +26,9 @@ { "$ref": "rum/view_update-schema.json" }, + { + "$ref": "rum/process-schema.json" + }, { "title": "RumVitalEvent", "oneOf": [ diff --git a/schemas/rum/_common-schema.json b/schemas/rum/_common-schema.json index 49560951..37d0bf44 100644 --- a/schemas/rum/_common-schema.json +++ b/schemas/rum/_common-schema.json @@ -122,6 +122,11 @@ "type": "string", "description": "User defined name of the view", "readOnly": false + }, + "is_fake": { + "type": "boolean", + "description": "Whether this view was synthetically created to carry view-less events", + "readOnly": true } }, "readOnly": true @@ -502,6 +507,30 @@ "readOnly": true } } + }, + "process": { + "type": "object", + "description": "Process properties", + "properties": { + "id": { + "type": "string", + "description": "UUID of the process", + "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$", + "readOnly": true + }, + "role": { + "type": "string", + "description": "Role of the process", + "enum": ["main", "renderer", "utility"], + "readOnly": true + }, + "name": { + "type": "string", + "description": "Process name", + "readOnly": true + } + }, + "readOnly": true } } } diff --git a/schemas/rum/process-schema.json b/schemas/rum/process-schema.json new file mode 100644 index 00000000..a09c7c89 --- /dev/null +++ b/schemas/rum/process-schema.json @@ -0,0 +1,95 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "$id": "rum/process-schema.json", + "title": "RumProcessEvent", + "type": "object", + "description": "Schema of all properties of a Process event", + "allOf": [ + { + "$ref": "_common-schema.json" + }, + { + "required": ["type", "process", "_dd"], + "properties": { + "type": { + "type": "string", + "description": "RUM event type", + "const": "process", + "readOnly": true + }, + "process": { + "type": "object", + "description": "Process properties", + "required": ["id", "role", "pid"], + "properties": { + "id": { + "type": "string", + "description": "UUID of the process", + "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$", + "readOnly": true + }, + "role": { + "type": "string", + "description": "Role of the process", + "enum": ["main", "renderer", "utility"], + "readOnly": true + }, + "pid": { + "type": "integer", + "description": "OS process ID", + "minimum": 0, + "readOnly": true + }, + "ppid": { + "type": "integer", + "description": "Parent OS process ID", + "minimum": 0, + "readOnly": true + }, + "name": { + "type": "string", + "description": "Process name", + "readOnly": true + }, + "duration": { + "type": "integer", + "description": "Process lifetime in nanoseconds", + "minimum": 0, + "readOnly": true + }, + "exit_reason": { + "type": "string", + "description": "Reason for process exit", + "enum": [ + "clean-exit", + "abnormal-exit", + "killed", + "crashed", + "oom", + "launch-failed", + "integrity-failure", + "memory-eviction" + ], + "readOnly": true + } + }, + "readOnly": true + }, + "_dd": { + "type": "object", + "description": "Internal properties", + "required": ["document_version"], + "properties": { + "document_version": { + "type": "integer", + "description": "Version of the update of the process event", + "minimum": 0, + "readOnly": true + } + }, + "readOnly": true + } + } + } + ] +}