Skip to content

RUM-13568: [Cronet]: Supporting RUM <> APM integration for Cronet#3136

Merged
satween merged 1 commit intodevelopfrom
tvaleev/feature/RUM-13568-apm-dependencies
Feb 10, 2026
Merged

RUM-13568: [Cronet]: Supporting RUM <> APM integration for Cronet#3136
satween merged 1 commit intodevelopfrom
tvaleev/feature/RUM-13568-apm-dependencies

Conversation

@satween
Copy link
Contributor

@satween satween commented Jan 20, 2026

What does this PR do?

In this PR we are copying the main logic from TracingInterceptor / DatadogInterceptor into the NetworkTracingInstrumentation in order to:

  1. Support RUM <> APM integration for Cronet
  2. Create a foundation for single network instrumentation logic that should be shared across several networking libraries in the future.

Motivation

Continuing to add an integration for Cronet library meanwhile preparing infrastructure to migrate OkHttp onto the same logic.

Additional Notes

Note that in this PR we are not supporting deep network instrumentation that is being done by TracingInterceptor in OkHttp. This logic will be supported in a further PR as this one is already pretty big.

NOTE: In this PR as an experiment an AI agent helped to write tests and some docs. I've made few iterations of a fixes for that but if you spot any issues - let me know. AI wasn't involved into production code development.

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)

@satween satween requested a review from a team as a code owner January 20, 2026 16:21
@satween
Copy link
Contributor Author

satween commented Jan 20, 2026

@codex

@chatgpt-codex-connector
Copy link

To use Codex here, create a Codex account and connect to github.

@kikoveiga
Copy link
Contributor

@codex review

Copy link

@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: 5ee7daf6e5

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

@satween satween force-pushed the tvaleev/feature/RUM-13568-apm-dependencies branch 5 times, most recently from 21d8777 to 3db3a62 Compare January 22, 2026 13:41
@datadog-official

This comment has been minimized.

@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 74.66863% with 172 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.24%. Comparing base (1d9888c) to head (b715ecb).

Files with missing lines Patch % Lines
...android/trace/internal/DatadogPropagationHelper.kt 62.94% 43 Missing and 10 partials ⚠️
...ndroid/trace/internal/ApmNetworkInstrumentation.kt 58.41% 31 Missing and 16 partials ⚠️
...oid/cronet/internal/DatadogCronetRequestContext.kt 87.62% 12 Missing and 1 partial ⚠️
.../com/datadog/android/cronet/DatadogCronetEngine.kt 63.64% 7 Missing and 5 partials ⚠️
...net/internal/DatadogRequestFinishedInfoListener.kt 47.37% 9 Missing and 1 partial ⚠️
...trace/internal/net/ApmNetworkInstrumentationExt.kt 73.08% 4 Missing and 3 partials ⚠️
...tadog/android/cronet/internal/DatadogUrlRequest.kt 61.11% 1 Missing and 6 partials ⚠️
.../android/cronet/internal/DatadogRequestCallback.kt 76.00% 6 Missing ⚠️
...id/trace/ApmNetworkInstrumentationConfiguration.kt 93.55% 4 Missing ⚠️
.../instrumentation/network/HttpRequestInfoBuilder.kt 0.00% 3 Missing ⚠️
... and 7 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3136      +/-   ##
===========================================
+ Coverage    70.96%   71.24%   +0.27%     
===========================================
  Files          912      922      +10     
  Lines        33557    34111     +554     
  Branches      5642     5775     +133     
===========================================
+ Hits         23813    24299     +486     
- Misses        8171     8177       +6     
- Partials      1573     1635      +62     
Files with missing lines Coverage Δ
...droid/flags/openfeature/internal/FlagsClientExt.kt 85.71% <ø> (ø)
...otlin/com/datadog/android/rum/_RumInternalProxy.kt 68.18% <100.00%> (+1.52%) ⬆️
...guration/RumNetworkInstrumentationConfiguration.kt 100.00% <100.00%> (ø)
.../android/rum/internal/monitor/DatadogRumMonitor.kt 88.40% <ø> (-0.11%) ⬇️
...roid/rum/internal/net/RumNetworkInstrumentation.kt 81.48% <100.00%> (ø)
...om/datadog/trace/core/propagation/B3HttpCodec.java 6.38% <ø> (ø)
...tadog/trace/core/propagation/DatadogHttpCodec.java 13.68% <ø> (ø)
...m/datadog/trace/core/propagation/W3CHttpCodec.java 12.99% <ø> (ø)
...om/datadog/android/trace/ApmNetworkTracingScope.kt 100.00% <100.00%> (ø)
...datadog/android/trace/DeterministicTraceSampler.kt 100.00% <100.00%> (ø)
... and 26 more

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

@satween satween force-pushed the tvaleev/feature/RUM-13568-apm-dependencies branch 2 times, most recently from 4ef7d94 to 6c726f5 Compare February 2, 2026 16:25
@satween satween requested review from 0xnm and ambushwork February 2, 2026 16:26
@satween satween force-pushed the tvaleev/feature/RUM-13568-apm-dependencies branch from 6c726f5 to 0e81151 Compare February 2, 2026 18:36
Copy link
Member

@0xnm 0xnm left a comment

Choose a reason for hiding this comment

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

I partially covered this PR, but will continue review later.

@satween satween force-pushed the tvaleev/feature/RUM-13568-apm-dependencies branch from 0e81151 to f636bd2 Compare February 5, 2026 16:09
@satween satween requested a review from 0xnm February 5, 2026 16:09
@satween satween force-pushed the tvaleev/feature/RUM-13568-apm-dependencies branch from f636bd2 to eb2e15e Compare February 10, 2026 00:00
@satween satween requested a review from 0xnm February 10, 2026 00:00
@satween satween force-pushed the tvaleev/feature/RUM-13568-apm-dependencies branch from eb2e15e to 5086f65 Compare February 10, 2026 00:44
@0xnm
Copy link
Member

0xnm commented Feb 10, 2026

@codex review

Copy link

@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: 5086f65e99

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

Copy link
Member

@0xnm 0xnm left a comment

Choose a reason for hiding this comment

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

Some final suggestions, otherwise lgtm.

Codex suggested something as well.

constructor(Float)
constructor(Double)
typealias TraceContextInjection = com.datadog.android.trace.TraceContextInjection
class com.datadog.android.okhttp.internal.OkHttpRequestInfoBuilder : com.datadog.android.api.instrumentation.network.HttpRequestInfoBuilder
Copy link
Member

Choose a reason for hiding this comment

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

should this class be public?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, for -otel module, it's marked with @InternalApi

@satween satween force-pushed the tvaleev/feature/RUM-13568-apm-dependencies branch from 5086f65 to b715ecb Compare February 10, 2026 12:58
@satween satween requested a review from 0xnm February 10, 2026 12:58
@satween satween merged commit e2d7d5b into develop Feb 10, 2026
26 checks passed
@satween satween deleted the tvaleev/feature/RUM-13568-apm-dependencies branch February 10, 2026 15:06
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