RUM-16535: Add APM client side stats models and encoder#3487
Merged
abrooksv merged 1 commit intoJun 3, 2026
Conversation
This comment has been minimized.
This comment has been minimized.
ca58d7e to
d85eadc
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/client-side-stats #3487 +/- ##
============================================================
Coverage ? 72.44%
============================================================
Files ? 967
Lines ? 35834
Branches ? 5951
============================================================
Hits ? 25958
Misses ? 8269
Partials ? 1607
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR introduces the client-side APM stats payload model types for the trace feature and a minimal MsgPack encoder to serialize them (with tests validating the produced payload structure against a reference MsgPack unpacker).
Changes:
- Added stats payload models (
StatsPayload,ClientStatsPayload, buckets, grouped stats, andTrilean) withtoMsgPackPayload()serialization. - Implemented a minimal
MsgPackEncoderand accompanying tests to validate encoding of core MsgPack primitives and headers. - Updated build/test configuration to include
msgpack-core, and updated 3rd-party licensing + detekt safe-call allowlist.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| LICENSE-3rdparty.csv | Adds 3rd-party license entry for org.msgpack:msgpack-core (test dependency). |
| gradle/libs.versions.toml | Adds version catalog entry for msgPackCore. |
| features/dd-sdk-android-trace/build.gradle.kts | Adds msgpack-core as a test dependency for the trace feature. |
| detekt_custom_safe_calls.yml | Allows additional safe calls used by the new encoder implementation. |
| features/dd-sdk-android-trace/src/main/kotlin/com/datadog/android/trace/internal/domain/metrics/StatsPayload.kt | Adds outer envelope model and MsgPack encoding for the stats intake payload. |
| features/dd-sdk-android-trace/src/main/kotlin/com/datadog/android/trace/internal/domain/metrics/MsgPackEncoder.kt | Adds the minimal MsgPack encoder used to build payload bytes. |
| features/dd-sdk-android-trace/src/main/kotlin/com/datadog/android/trace/internal/domain/metrics/ClientStatsPayload.kt | Adds client stats payload/bucket/grouped stats models and encoding. |
| features/dd-sdk-android-trace/src/test/kotlin/com/datadog/android/trace/internal/domain/metrics/StatsPayloadTest.kt | Validates the outer payload fields and embedding of pre-encoded client stats. |
| features/dd-sdk-android-trace/src/test/kotlin/com/datadog/android/trace/internal/domain/metrics/MsgPackEncoderTest.kt | Validates encoding of MsgPack primitives/headers via msgpack-core unpacking. |
| features/dd-sdk-android-trace/src/test/kotlin/com/datadog/android/trace/internal/domain/metrics/ClientStatsPayloadTest.kt | Validates the client stats payload field mapping and nested objects. |
| features/dd-sdk-android-trace/src/test/kotlin/com/datadog/android/trace/assertj/MsgPackAssert.kt | Adds a MsgPack-to-JSON assert helper for payload structure assertions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5122318 to
593f193
Compare
Adds the intake models for the APM client side stats Add a minimal MsgPack encoder to serialize the models
62990a1 to
88ca466
Compare
0xnm
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Models the data classes for the APM client side stats payloads: (definition)
Note that while that definition is for a protobuf format, we will be uploading them in their MsgPack format, and the field mappings can be found here
To keep runtime dependency graph small, a minimal encoder is included, but a test dependency on a reference implementation is included in order to validate the implementation
Motivation
This PR models the classes that will eventually be uploaded to the stats intake endpoint.
Additional Notes
The fields we will be sending are based off of the iOS RFC, but which has not yet been put out for code review
Review checklist (to be filled by reviewers)