Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
11 changes: 11 additions & 0 deletions schemas/rum-events-mobile-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@
},
{
"$ref": "telemetry-events-schema.json"
},
{
"title": "RumTimeseriesEvent",
"oneOf": [
Comment on lines +43 to +45

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add timeseries to the aggregate RUM schema

This block only registers the new event in the mobile schema, but schemas/rum-events-schema.json remains unchanged while scripts/generate.mjs:15 uses that aggregate schema to generate the exported RumEvent types. When consumers validate or generate from the aggregate schema, these mobile timeseries payloads are still rejected and omitted from the package types even though they are now valid mobile RUM events; add the same timeseries branch there and regenerate the definitions.

Useful? React with 👍 / 👎.

{
"$ref": "rum/timeseries-memory-schema.json"
},
{
"$ref": "rum/timeseries-cpu-schema.json"
}
]
}
]
}
93 changes: 93 additions & 0 deletions schemas/rum/timeseries-cpu-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "rum/timeseries-cpu-schema.json",
"title": "RumTimeseriesCpuEvent",
"type": "object",
"description": "Schema for a CPU timeseries event.",
"allOf": [
{
"$ref": "_common-schema.json"
},
{
"required": ["type", "timeseries"],
"properties": {
"type": {
"type": "string",
"description": "RUM event type",
"const": "timeseries",
"readOnly": true
},
"timeseries": {
"type": "object",
"description": "CPU timeseries properties",
"required": ["id", "name", "schema", "start", "end", "data"],
"properties": {
"id": {
"type": "string",
"description": "UUID of the timeseries batch",
"pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
"readOnly": true
},
"name": {
"type": "string",
"description": "Name identifying the timeseries metric",
"const": "cpu",
"readOnly": true
},
"schema": {
"type": "string",
"description": "Wire-shape discriminator for the data field",
"const": "object-v2",
"readOnly": true
},
"start": {
"type": "integer",
"description": "Timestamp of the first sample in nanoseconds from epoch",
"readOnly": true
},
"end": {
"type": "integer",
"description": "Timestamp of the last sample in nanoseconds from epoch",
"readOnly": true
},
"data": {
"type": "object",
"description": "Flattened CPU data points",
"required": ["timestamps", "values"],
"properties": {
"timestamps": {
"type": "array",
"description": "Sample timestamps in nanoseconds from epoch",
"items": {
"type": "integer",
"readOnly": true
},
"readOnly": true
},
"values": {
"type": "object",
"description": "CPU measurements, aligned index-for-index with timestamps",
"required": ["cpu_usage"],
"properties": {
"cpu_usage": {
"type": "array",
"description": "CPU usage as a percentage (0.0 to 100.0)",
"items": {
"type": "number",
"readOnly": true
},
"readOnly": true
}
},
"readOnly": true
}
},
"readOnly": true
}
},
"readOnly": true
}
}
}
]
}
102 changes: 102 additions & 0 deletions schemas/rum/timeseries-memory-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "rum/timeseries-memory-schema.json",
"title": "RumTimeseriesMemoryEvent",
"type": "object",
"description": "Schema for a memory timeseries event.",
"allOf": [
{
"$ref": "_common-schema.json"
},
{
"required": ["type", "timeseries"],
"properties": {
"type": {
"type": "string",
"description": "RUM event type",
"const": "timeseries",
"readOnly": true
},
"timeseries": {
"type": "object",
"description": "Memory timeseries properties",
"required": ["id", "name", "schema", "start", "end", "data"],
"properties": {
"id": {
"type": "string",
"description": "UUID of the timeseries batch",
"pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
"readOnly": true
},
"name": {
"type": "string",
"description": "Name identifying the timeseries metric",
"const": "memory",
"readOnly": true
},
"schema": {
"type": "string",
"description": "Wire-shape discriminator for the data field",
"const": "object-v2",
"readOnly": true
},
"start": {
"type": "integer",
"description": "Timestamp of the first sample in nanoseconds from epoch",
"readOnly": true
},
"end": {
"type": "integer",
"description": "Timestamp of the last sample in nanoseconds from epoch",
"readOnly": true
},
"data": {
"type": "object",
"description": "Flattened memory data points",
"required": ["timestamps", "values"],
"properties": {
"timestamps": {
"type": "array",
"description": "Sample timestamps in nanoseconds from epoch",
"items": {
"type": "integer",
"readOnly": true
},
"readOnly": true
},
"values": {
"type": "object",
"description": "Memory measurements, aligned index-for-index with timestamps",
"required": ["memory_footprint", "memory_percent"],
"properties": {
"memory_footprint": {
"type": "array",
"description": "Physical memory footprint of the process in kilobytes",
"items": {
"type": "number",
"readOnly": true
},
"readOnly": true
},
"memory_percent": {
"type": "array",
"description": "Memory footprint as a percentage of total device RAM",
"items": {
"type": "number",
"readOnly": true
},
"readOnly": true
}
},
"readOnly": true
}
},
"readOnly": true
}
},
"readOnly": true
}
}
}
]
}
Loading