RUM-16564: Create and register stub for client stats feature if enabled#3523
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/client-side-stats #3523 +/- ##
=============================================================
- Coverage 72.52% 72.51% -0.01%
=============================================================
Files 971 973 +2
Lines 36071 36121 +50
Branches 5989 5995 +6
=============================================================
+ Hits 26158 26192 +34
- Misses 8292 8306 +14
- Partials 1621 1623 +2
🚀 New features to boost your workflow:
|
56753f2 to
85a4301
Compare
The client stats feature is wired into the CoreTracer via the MetricsAggregator interface. This is the same interface that dd-trace-java uses to implement the aggregation of client stats before submitting them to the agent, so it is already wired into the correct spot in CoreTracer.
85a4301 to
ef42e92
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef42e92da7
ℹ️ 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".
| internal val networkInfoEnabled: Boolean, | ||
| internal val statsComputationEnabled: Boolean | ||
| internal val statsComputationEnabled: Boolean, | ||
| internal val customStatsEndpointUrl: String? |
There was a problem hiding this comment.
Preserve TraceConfiguration copy binary compatibility
Adding customStatsEndpointUrl to the primary constructor of this public data class changes the generated copy(...) and copy$default(...) JVM signatures, as reflected in the API diff. Apps compiled against the previous SDK that call TraceConfiguration.copy(...) can then fail with NoSuchMethodError after upgrading the runtime artifact, even though their source still compiles; keep the generated data-class constructor/copy shape stable and store the new internal value outside the primary constructor or behind an overload.
Useful? React with 👍 / 👎.
| ): Request { | ||
| val requestId = UUID.randomUUID().toString() | ||
|
|
||
| val baseUrl = customStatsEndpointUrl ?: (context.site.intakeEndpoint + "/api/v0.2/stats") |
There was a problem hiding this comment.
is it indeed like that - v0.2 or it should be v2 here?
There was a problem hiding this comment.
What does this PR do?
The client stats feature is wired into the CoreTracer via the MetricsAggregator interface defined in the internal tracer module. This is the same interface that dd-trace-java uses to implement the aggregation of client stats before submitting them to the agent, so it is already wired into the correct spot in CoreTracer (before span sampling occurs).
A new config value was also added so we can override the intake location for the stats intake, since it needs to be different than the /spans endpoint that the TraceConfiguration already configures.
Motivation
Sets up the SDK feature for receiving the spans for client stats aggregation from CoreTracer
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)