Skip to content

timeseries RUM-13949: Add timeseries JSON schemas and regenerate API surface#3431

Merged
satween merged 3 commits into
feature/timeseriesfrom
tvaleev/feature/RUM-13949/timeseries-json-schemas-api-surface
May 14, 2026
Merged

timeseries RUM-13949: Add timeseries JSON schemas and regenerate API surface#3431
satween merged 3 commits into
feature/timeseriesfrom
tvaleev/feature/RUM-13949/timeseries-json-schemas-api-surface

Conversation

@satween
Copy link
Copy Markdown
Contributor

@satween satween commented May 12, 2026

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.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

### 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.
@satween satween changed the title RUM-13949 Add timeseries JSON schemas and regenerate API surface RUM-13949 timeseries: Add timeseries JSON schemas and regenerate API surface May 12, 2026
@satween satween changed the title RUM-13949 timeseries: Add timeseries JSON schemas and regenerate API surface timeseries: RUM-13949: Add timeseries JSON schemas and regenerate API surface May 12, 2026
@satween satween changed the title timeseries: RUM-13949: Add timeseries JSON schemas and regenerate API surface timeseries RUM-13949: Add timeseries JSON schemas and regenerate API surface May 12, 2026
@satween satween marked this pull request as ready for review May 13, 2026 13:50
@satween satween requested review from a team as code owners May 13, 2026 13:50
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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"],
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 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

@satween satween May 13, 2026

Choose a reason for hiding this comment

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

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.

Comment thread features/dd-sdk-android-rum/generate_rum_models.gradle.kts Outdated
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-commenter
Copy link
Copy Markdown

codecov-commenter commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.05%. Comparing base (90d2c73) to head (7291ea8).

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     

see 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@satween satween requested a review from 0xnm May 13, 2026 14:45
"title": "RumTimeseriesCpuEvent",
"type": "object",
"description": "Schema for a CPU timeseries event.",
"required": ["_dd", "application", "date", "session", "source", "timeseries", "type"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Should we follow this order of fields below? Applies to the other files as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this file copied from rum-event-schema repo as is

@satween satween merged commit b6b5268 into feature/timeseries May 14, 2026
28 checks passed
@satween satween deleted the tvaleev/feature/RUM-13949/timeseries-json-schemas-api-surface branch May 14, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants