timeseries RUM-13949: Add timeseries JSON schemas and regenerate API surface#3431
Conversation
### What does this PR do? Adds JSON schemas for the CPU and memory timeseries event types (`timeseries-cpu-schema.json`, `timeseries-memory-schema.json`), registers them in the model-generation Gradle task, and updates the generated `api/apiSurface` and `api/dd-sdk-android-rum.api` files to reflect the new `RumTimeseriesCpuEvent`, `RumTimeseriesMemoryEvent`, and `TimeseriesConfiguration` public surface. ### Motivation The timeseries feature needs a well-defined wire format (JSON schemas) and generated Kotlin model classes before any collector or serializer code can reference them. ### Additional Notes The generated Kotlin model classes (`RumTimeseriesCpuEvent`, `RumTimeseriesMemoryEvent`) are produced at build time from these schemas via the existing `generateRumModelsFromJson` task and are not included in this commit.
timeseries: Add timeseries JSON schemas and regenerate API surface
timeseries: Add timeseries JSON schemas and regenerate API surfacetimeseries: RUM-13949: Add timeseries JSON schemas and regenerate API surface
timeseries: RUM-13949: Add timeseries JSON schemas and regenerate API surfacetimeseries RUM-13949: Add timeseries JSON schemas and regenerate API surface
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 96392b6a17
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "schema": { | ||
| "type": "string", | ||
| "description": "Wire-shape discriminator for the data field", | ||
| "enum": ["object", "delta-scalar"], |
There was a problem hiding this comment.
Align delta schemas with their data wire shape
When callers select the advertised DELTA_SCALAR CPU schema, the generated model still serializes each data entry as an object containing timestamp and data_point.cpu_usage, because the data schema below is unconditional. That produces object-shaped payloads while declaring the delta-scalar wire shape, so any collector path that tries to use the compact delta format will emit events the backend/decoder cannot interpret as delta-scalar. The same mismatch exists for the memory delta-object enum; either model the alternate data shape with oneOf/conditionals or do not expose the delta schema values until they are supported.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is expected and it's temporary solution while we are dogfooding the timeseries on shopist. After dogfooding results - only one schema format gonna be kept.
Aligns timeseries model class names with the existing convention used
by ActionEvent, ErrorEvent, ViewEvent etc. (the inputNameMapping in
generate_rum_models.gradle.kts already strips the Rum prefix that
appears in the JSON schema titles).
- generate_rum_models.gradle.kts: map both schemas to
Timeseries{Memory,Cpu}Event.
- features/dd-sdk-android-rum/api: regenerate apiSurface and api dump.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/timeseries #3431 +/- ##
======================================================
- Coverage 72.26% 72.05% -0.21%
======================================================
Files 961 961
Lines 35418 35418
Branches 5883 5883
======================================================
- Hits 25593 25519 -74
- Misses 8235 8284 +49
- Partials 1590 1615 +25 🚀 New features to boost your workflow:
|
| "title": "RumTimeseriesCpuEvent", | ||
| "type": "object", | ||
| "description": "Schema for a CPU timeseries event.", | ||
| "required": ["_dd", "application", "date", "session", "source", "timeseries", "type"], |
There was a problem hiding this comment.
nit: Should we follow this order of fields below? Applies to the other files as well.
There was a problem hiding this comment.
this file copied from rum-event-schema repo as is

What does this PR do?
Adds JSON schemas for the CPU and memory timeseries event types (
timeseries-cpu-schema.json,timeseries-memory-schema.json), registers them in the model-generation Gradle task, and updates the generatedapi/apiSurfaceandapi/dd-sdk-android-rum.apifiles to reflect the newRumTimeseriesCpuEvent,RumTimeseriesMemoryEvent, andTimeseriesConfigurationpublic surface.Review checklist (to be filled by reviewers)