Skip to content

RUM-11784: Update RUM Schema to include app launch vitals#2937

Merged
aleksandr-gringauz merged 1 commit into
developfrom
aleksandr-gringauz/RUM-11784/update-vitals-schema
Oct 14, 2025
Merged

RUM-11784: Update RUM Schema to include app launch vitals#2937
aleksandr-gringauz merged 1 commit into
developfrom
aleksandr-gringauz/RUM-11784/update-vitals-schema

Conversation

@aleksandr-gringauz

@aleksandr-gringauz aleksandr-gringauz commented Oct 13, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR pulls the most recent RUM events schema and updates the code to use it.

The goal is to use the new application launch vital introduced here. But it will be done in future PRs. I plan to merge this PR to develop.

The current PR:

  1. Fixes the build errors and adapts code related to feature operations to the schema changes.
  2. Fixes the json parser generator so that the following schema works correctly:
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "RequiredForOtherAllOf",
  "type": "object",
  "allOf": [
    {
      "type": "object",
      "properties": {
        "key_1": { "type": "string" }
      }
    },
    {
      "type": "object",
      "required": ["key_1", "key_2"],
      "properties": {
        "key_2": { "type": "string" }
      }
    }
  ]
}

key_1 should be non-null in the resulting data class. See other comments in the PR for further explanation. This change is needed to properly support this change. Otherwise view becomes optional for example in ErrorEvent which is not what we intended to do.

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

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)

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Oct 13, 2025

Copy link
Copy Markdown

🎯 Code Coverage
Patch Coverage: 100.00%
Total Coverage: 70.79% (+0.04%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a22b805 | Docs | Was this helpful? Give us feedback!

data class Class(
val name: String,
val properties: List<TypeProperty>,
val required: Set<String>,

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.

The idea is the following.

We store the information about the required fields here instead of storing val optional: Boolean in TypeDefinition. Because if there is no TypeDefinition corresponding to the key in required block, we lose the information that this field is required. And if this key actually occurs in another item of allOf we don't treat it as required after merging (this is what I want to fix).

"$ref": "subfolder/external_description_proxy.json#/definitions/contact"
}
},
"required": [

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.

These item and destination don't actually exists in this schema. Before my fix the test passed, because the generator only looked at this required block while iterating through the properties (to determine the val optional: Boolean field).

"description": "User provided context",
"additionalProperties": true
},
"stream": {

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 isn't related to vitals, some other new stuff.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's maybe just remove this if not needed for now?

@aleksandr-gringauz
aleksandr-gringauz marked this pull request as ready for review October 13, 2025 15:53
@aleksandr-gringauz
aleksandr-gringauz requested review from a team as code owners October 13, 2025 15:53
@codecov-commenter

codecov-commenter commented Oct 13, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 70.77%. Comparing base (18545bb) to head (a22b805).

Files with missing lines Patch % Lines
...g/android/rum/internal/domain/scope/RumEventExt.kt 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2937      +/-   ##
===========================================
- Coverage    70.87%   70.77%   -0.10%     
===========================================
  Files          829      829              
  Lines        30384    30383       -1     
  Branches      5183     5183              
===========================================
- Hits         21534    21503      -31     
- Misses        7378     7413      +35     
+ Partials      1472     1467       -5     
Files with missing lines Coverage Δ
.../android/rum/internal/domain/scope/RumViewScope.kt 94.09% <100.00%> (+0.19%) ⬆️
...g/android/rum/internal/domain/scope/RumEventExt.kt 90.11% <50.00%> (-2.54%) ⬇️

... and 35 files with indirect coverage changes

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

@0xnm 0xnm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm, but I think we need to remove properties/files from this PR which we don't use yet (and maybe we never will).

"description": "User provided context",
"additionalProperties": true
},
"stream": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's maybe just remove this if not needed for now?

Comment thread features/dd-sdk-android-rum/generate_rum_models.gradle.kts Outdated
Comment thread features/dd-sdk-android-rum/generate_rum_models.gradle.kts Outdated
Comment thread features/dd-sdk-android-rum/src/main/json/rum/view-schema.json Outdated
ambushwork
ambushwork previously approved these changes Oct 14, 2025
fun fromJson(kotlin.String): Configuration
fun fromJsonObject(com.google.gson.JsonObject): Configuration
data class DdVital
data class Vital1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

not the best naming, but I guess we can live with that

fun fromJsonObject(com.google.gson.JsonObject): Device
data class Dd
constructor(DdSession? = null, Configuration? = null, kotlin.String? = null, kotlin.String? = null, DdVital? = null)
constructor(DdSession? = null, Configuration? = null, kotlin.String? = null, kotlin.String? = null, Vital1? = null, Profiling? = null)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just a sanity check: property name is still vital?

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.

@aleksandr-gringauz
aleksandr-gringauz merged commit 0924ea2 into develop Oct 14, 2025
25 checks passed
@aleksandr-gringauz
aleksandr-gringauz deleted the aleksandr-gringauz/RUM-11784/update-vitals-schema branch October 14, 2025 10:52
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