Skip to content

RUM-17846: Add remote configuration sync/apply metadata to configuration telemetry - #3742

Open
hamorillo wants to merge 8 commits into
feature/remote-configfrom
hector.morilloprieto/RUM-17846
Open

RUM-17846: Add remote configuration sync/apply metadata to configuration telemetry#3742
hamorillo wants to merge 8 commits into
feature/remote-configfrom
hector.morilloprieto/RUM-17846

Conversation

@hamorillo

Copy link
Copy Markdown
Contributor

What does this PR do?

Attaches remote configuration sync/apply metadata to the SDK's once-per-session configuration telemetry event: a remote_configuration object (config_id, version_id, last_modified, last_synced, first_applied, sync_id), plus the previously-unpopulated remote_configuration_id field.

Motivation

Gives visibility into CDN-fetch-to-apply propagation delay for remote config, mirroring dd-sdk-ios#3112.

Additional Notes

  • API surface changes are additive only: new RemoteConfigSyncMetadata model, InternalSdkCore.remoteConfigurationSyncMetadata, TelemetryConfigurationEvent.RemoteConfiguration.
  • Verified end-to-end on device against the live CDN.

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)

@hamorillo

Copy link
Copy Markdown
Contributor Author

@codex review

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

Copy link
Copy Markdown

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: b8f56191e9

ℹ️ 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".

@datadog-official

datadog-official Bot commented Aug 20, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 87.07%
Overall Coverage: 73.94% (+0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a684a4a | Docs | View more details | Give us feedback!

@codecov-commenter

codecov-commenter commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.23077% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.23%. Comparing base (e146bb1) to head (a684a4a).

Files with missing lines Patch % Lines
.../internal/remote/model/RemoteConfigSyncMetadata.kt 84.21% 3 Missing and 3 partials ⚠️
...n/com/datadog/android/core/internal/DatadogCore.kt 50.00% 3 Missing ⚠️
...ndroid/core/internal/remote/RemoteConfigService.kt 95.00% 0 Missing and 3 partials ⚠️
...tadog/android/core/internal/NoOpInternalSdkCore.kt 0.00% 1 Missing ⚠️
...ndroid/core/internal/remote/RemoteConfigFetcher.kt 92.31% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##           feature/remote-config    #3742      +/-   ##
=========================================================
- Coverage                  73.23%   73.23%   -0.00%     
=========================================================
  Files                       1006     1007       +1     
  Lines                      36851    36895      +44     
  Branches                    6386     6396      +10     
=========================================================
+ Hits                       26986    27018      +32     
- Misses                      8038     8047       +9     
- Partials                    1827     1830       +3     
Files with missing lines Coverage Δ
...kotlin/com/datadog/android/core/InternalSdkCore.kt 0.00% <ø> (ø)
...ndroid/telemetry/internal/TelemetryEventHandler.kt 88.21% <100.00%> (-1.29%) ⬇️
...tadog/android/core/internal/NoOpInternalSdkCore.kt 22.41% <0.00%> (-0.19%) ⬇️
...ndroid/core/internal/remote/RemoteConfigFetcher.kt 94.20% <92.31%> (-0.53%) ⬇️
...n/com/datadog/android/core/internal/DatadogCore.kt 80.00% <50.00%> (-0.46%) ⬇️
...ndroid/core/internal/remote/RemoteConfigService.kt 95.50% <95.00%> (-1.06%) ⬇️
.../internal/remote/model/RemoteConfigSyncMetadata.kt 84.21% <84.21%> (ø)

... and 33 files with indirect coverage changes

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

@hamorillo
hamorillo marked this pull request as ready for review August 20, 2026 13:45
@hamorillo
hamorillo requested review from a team as code owners August 20, 2026 13:45

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

Copy link
Copy Markdown

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: 98b9cda8d6

ℹ️ 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".

Comment thread features/dd-sdk-android-rum/api/dd-sdk-android-rum.api
@Suppress("ThreadSafety")
syncMetadata = allowThreadDiskReads { readMetadataFromDisk() }

// Stamp firstApplied asynchronously — ordering is guaranteed. Only when there is a

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.

what if configuration telemetry is sent before firstApplied is written? We will not send it for the session that actually applied this config. Is it possible?

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.

We could change syncMetadata synchronously here, but write to disk asyncronously.

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.

We could change syncMetadata synchronously here, but write to disk asyncronously.

We can do that, but I think it is not really necessary. Both share the same executor, so the execution will be linear with this written always executed before.
In addition, the SDK have a delay for the configuration telemetry event.

* The outcome of a genuinely new (non-304) fetch: a fresh body along with the CDN metadata
* needed to track sync/apply telemetry for the version it belongs to.
*/
data class FetchResult(

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.

Small suggestion, it might make the code more readable.

We can make this FetchResult a sealed class/interface:

sealed interface FetchResult {
    data class NewResult(
        body, 
        versionId, 
        lastModified, 
        syncTime, // goes to lastSynched later
        syncId // maybe even syncId here, but up to you
    ): FetchResult
    data class FromCache(
        body,
        versionId,
        lastModified,
        networkRequestMade, // was it 304 response or the response was returned from cache without a real network request
    ): FetchResult
    object Error: FetchResult
}

Because currently null is returned both when some error occured and when the result was obtained from cache.

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.

I don't think we need that distinction right now, but it's definitely a nice suggestion! Let me know if you think this is a blocker or if it could be a follow-up (happy to work on this in a different PR).

val lastSynced: Long,
val firstApplied: Long?,
val syncId: String
) {

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:

ideally this toJson and fromJson code should be generated.

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.

That would be nice. This doesn't come from the schema, so I'm not sure if we've done something similar in the SDK before. I can create a ticket with low priority to review it.

@hamorillo
hamorillo force-pushed the hector.morilloprieto/RUM-17846 branch from 98b9cda to a684a4a Compare August 20, 2026 15:26

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

Copy link
Copy Markdown

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: a684a4a5d6

ℹ️ 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".

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.

3 participants