Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUM-1844: Add Method Call Telemetry #1940

Merged
merged 9 commits into from
May 2, 2024

Conversation

jonathanmos
Copy link
Contributor

@jonathanmos jonathanmos commented Mar 26, 2024

What does this PR do?

Adds telemetry for view tree traversal time

Device and OS properties were added to debug and error telemetry. This required adding a fix for TypeDefinition to correctly merge additionalProperties (since the "telemetry" property now exists in the common schema). Also, I've opened a pr for rum-events-format to modify the schema there

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)

@jonathanmos jonathanmos changed the title RM-1844: Add Method Call Telemetry RUM-1844: Add Method Call Telemetry Mar 26, 2024
@jonathanmos jonathanmos force-pushed the jmoskovich/rum-1844/method-call-telemetry branch from 2eccdbe to ba05245 Compare March 26, 2024 23:39
@codecov-commenter
Copy link

codecov-commenter commented Mar 26, 2024

Codecov Report

Attention: Patch coverage is 69.86301% with 22 lines in your changes are missing coverage. Please review.

Project coverage is 83.17%. Comparing base (5e0f0f2) to head (3e5a159).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1940      +/-   ##
===========================================
- Coverage    83.55%   83.17%   -0.38%     
===========================================
  Files          478      481       +3     
  Lines        17576    17643      +67     
  Branches      2672     2682      +10     
===========================================
- Hits         14684    14673      -11     
- Misses        2164     2239      +75     
- Partials       728      731       +3     
Files Coverage Δ
...in/com/datadog/android/api/feature/FeatureScope.kt 0.00% <ø> (ø)
...adog/android/core/metrics/MethodCalledTelemetry.kt 100.00% <100.00%> (ø)
...dog/android/sessionreplay/SessionReplayRecorder.kt 96.40% <100.00%> (ø)
...nternal/recorder/listener/WindowsOnDrawListener.kt 95.00% <100.00%> (+5.34%) ⬆️
...atadog/android/core/metrics/TelemetryMetricType.kt 0.00% <0.00%> (ø)
...in/com/datadog/android/core/internal/SdkFeature.kt 86.34% <0.00%> (-2.77%) ⬇️
.../datadog/android/core/metrics/PerformanceMetric.kt 0.00% <0.00%> (ø)
...ndroid/telemetry/internal/TelemetryEventHandler.kt 80.21% <75.00%> (-0.40%) ⬇️

... and 26 files with indirect coverage changes

@jonathanmos jonathanmos marked this pull request as ready for review March 27, 2024 09:27
@jonathanmos jonathanmos requested review from a team as code owners March 27, 2024 09:27
@jonathanmos jonathanmos marked this pull request as draft March 27, 2024 09:31
@jonathanmos jonathanmos marked this pull request as ready for review March 27, 2024 10:32
Copy link

@maciejburda maciejburda left a comment

Choose a reason for hiding this comment

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

@jonathanmos jonathanmos force-pushed the jmoskovich/rum-1844/method-call-telemetry branch from 413769b to 0069f66 Compare April 17, 2024 11:46
@jonathanmos jonathanmos force-pushed the jmoskovich/rum-1844/method-call-telemetry branch from 7c1d16c to bbcafbe Compare April 18, 2024 11:48
@jonathanmos jonathanmos force-pushed the jmoskovich/rum-1844/method-call-telemetry branch from 459f83d to 50ab1fc Compare April 28, 2024 15:42
@jonathanmos jonathanmos force-pushed the jmoskovich/rum-1844/method-call-telemetry branch from 50ab1fc to c9854fa Compare April 28, 2024 22:12
@jonathanmos jonathanmos force-pushed the jmoskovich/rum-1844/method-call-telemetry branch from c9854fa to d951c21 Compare May 2, 2024 09:04
@jonathanmos jonathanmos merged commit 0f0d124 into develop May 2, 2024
21 checks passed
@jonathanmos jonathanmos deleted the jmoskovich/rum-1844/method-call-telemetry branch May 2, 2024 15:30
* @param samplingRate value between 0-100 for sampling the event.
* @return a PerformanceMetric object that can later be used to send telemetry, or null if sampled out
*/
fun startPerformanceMeasure(
Copy link
Contributor

Choose a reason for hiding this comment

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

why this one is a part of the FeatureScope? by looking on the implementation it has nothing to do with the Feature - it takes InternalLogger, which is bound to the SDK core and the rest is just the arguments passed to the method. Is it implemented the same way on iOS?

/**
* Base class for performance metric events.
*/
interface PerformanceMetric {
Copy link
Contributor

Choose a reason for hiding this comment

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

these metrics are going to our telemetry, so it makes sense to put @InternalApi annotation here.

* @param logger - an instance of the internal logger.
* @param startTime - the time when the metric is instantiated, to be used as the start point for the measurement.
*/
class MethodCalledTelemetry(
Copy link
Contributor

Choose a reason for hiding this comment

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

this one can be internal class if I'm not wrong, it is not used outside the package, it seems? And instances anyway are created via PerformanceMetric#startMetric

Comment on lines +40 to +41
internalSdkCore: InternalSdkCore? = Datadog.getInstance() as? InternalSdkCore,
private val deviceInfo: DeviceInfo? = internalSdkCore?.getDatadogContext()?.deviceInfo
Copy link
Contributor

Choose a reason for hiding this comment

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

why this is needed, if inside handleEvent method there is already DatadogContext provided as a part of withWriteContext lambda?

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.

None yet

6 participants