Skip to content

Update RUM schema#2976

Merged
aleksandr-gringauz merged 3 commits into
developfrom
aleksandr-gringauz/rum-schema-update-2
Nov 4, 2025
Merged

Update RUM schema#2976
aleksandr-gringauz merged 3 commits into
developfrom
aleksandr-gringauz/rum-schema-update-2

Conversation

@aleksandr-gringauz

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

Copy link
Copy Markdown
Contributor

What does this PR do?

Updating RUM schema to include this change. It split vital event into 3 different events:

  1. vital-duration-schema
  2. vital-app-launch-schema
  3. vital-operation-step-schema

They don't have the same parent anymore. They are distinct event types.

There was also some refactoring arount view field link.

The changes are so huge because a lot of classes classes in the api-surface files are now in a different order for some reason.

Similar PR on iOS DataDog/dd-sdk-ios#2548

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-official

datadog-official Bot commented Oct 31, 2025

Copy link
Copy Markdown

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

View detailed report

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

@codecov-commenter

codecov-commenter commented Oct 31, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.35714% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.88%. Comparing base (fa9de09) to head (b48ee7a).

Files with missing lines Patch % Lines
...g/android/rum/internal/domain/scope/RumEventExt.kt 70.37% 8 Missing ⚠️
.../android/rum/internal/domain/scope/RumViewScope.kt 89.47% 1 Missing and 1 partial ⚠️
...kotlin/com/datadog/android/rum/RumConfiguration.kt 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2976      +/-   ##
===========================================
+ Coverage    70.87%   70.88%   +0.01%     
===========================================
  Files          829      829              
  Lines        30383    30384       +1     
  Branches      5186     5186              
===========================================
+ Hits         21533    21537       +4     
- Misses        7370     7374       +4     
+ Partials      1480     1473       -7     
Files with missing lines Coverage Δ
...lin/com/datadog/android/rum/internal/RumFeature.kt 89.19% <100.00%> (+0.25%) ⬆️
.../datadog/android/rum/internal/RumSessionTypeExt.kt 100.00% <100.00%> (ø)
...ndroid/rum/internal/domain/event/RumEventMapper.kt 100.00% <100.00%> (ø)
...id/rum/internal/domain/event/RumEventSerializer.kt 97.81% <100.00%> (+2.19%) ⬆️
...kotlin/com/datadog/android/rum/RumConfiguration.kt 96.30% <50.00%> (-1.20%) ⬇️
.../android/rum/internal/domain/scope/RumViewScope.kt 93.59% <89.47%> (-0.39%) ⬇️
...g/android/rum/internal/domain/scope/RumEventExt.kt 92.09% <70.37%> (-2.26%) ⬇️

... and 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.

*/
fun setVitalEventMapper(eventMapper: EventMapper<VitalEvent>): Builder {
rumConfig = rumConfig.copy(vitalEventMapper = eventMapper)
fun setVitalOperationStepEventMapper(eventMapper: EventMapper<RumVitalOperationStepEvent>): Builder {

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.

Important

This is a change of the public API that was already released.

Even if we don't change the name of the method, there is still a change in the function signature (because of the argument type).

It is probably ok, because feature operations are fairly recent are still under ExperimentalRumAPI (not this particular method though).

But I'm not entirely sure.

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.

Is it also a similar change for iOS SDK?

Maybe we can keep both methods for now: deprecate old one and make it alias for a new one. Old one will have a change of the argument type, but this is fine, because anyway it is functional interface (so no need to specify type explicitly) and new model has almost the same structure as the old one.

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.

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.

but this is fine, because anyway it is functional interface (so no need to specify type explicitly)

import com.datadog.android.event.EventMapper
import com.datadog.android.rum.model.RumVitalOperationStepEvent

object SomeMapper : EventMapper<RumVitalOperationStepEvent> {
    override fun map(event: RumVitalOperationStepEvent): RumVitalOperationStepEvent? {
        TODO("Not yet implemented")
    }
}

If you want to implement the mapper in a separate file, you have to. And IIUC binary compatibility is still broken.

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.

yes, totally. once it is not a functional SAM conversion change is not backward compatible.

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.

It is probably ok, because feature operations are fairly recent are still under ExperimentalRumAPI (not this particular method though).

Feature Operations are indeed marked as experimental, but setVitalEventMapper is not.

I think we can deprecate it and keep it, making it either no-op (since once we add more Vital mappers it is not clear to which one it corresponds) or forward call to setVitalOperationStepEventMapper (since it is the only Vital we have right now).

This will be more compliant with semver semantics.

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.

OK

  1. Returned setVitalEventMapper and made it Deprecated.
  2. Made setVitalEventMapper call setVitalOperationStepEventMapper.
  3. Annotated setVitalOperationStepEventMapper with ExperimentalRumApi. To be similar with other feature operations methods.

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.

The setVitalEventMapper wasn't planned as experimental as there was different types of VitalEvents and @ExperimentalRumApi was applied only for the Feature Operation. But according to the latest changes it might make sense to add this annotation for the setting mapper method as well.

@aleksandr-gringauz
aleksandr-gringauz marked this pull request as ready for review October 31, 2025 16:55
@aleksandr-gringauz
aleksandr-gringauz requested review from a team as code owners October 31, 2025 16:55
ambushwork
ambushwork previously approved these changes Nov 4, 2025
@aleksandr-gringauz
aleksandr-gringauz force-pushed the aleksandr-gringauz/rum-schema-update-2 branch 2 times, most recently from fd409ec to 6043abe Compare November 4, 2025 11:54
0xnm
0xnm previously approved these changes Nov 4, 2025
satween
satween previously approved these changes Nov 4, 2025
@aleksandr-gringauz
aleksandr-gringauz merged commit 4e9b85d into develop Nov 4, 2025
26 checks passed
@aleksandr-gringauz
aleksandr-gringauz deleted the aleksandr-gringauz/rum-schema-update-2 branch November 4, 2025 15:45
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.

5 participants