Skip to content

Adjust telemetry metrics sampling rates#2490

Merged
xgouchet merged 1 commit into
developfrom
xgouchet/adjust_metric_sampling_rate
Jan 27, 2025
Merged

Adjust telemetry metrics sampling rates#2490
xgouchet merged 1 commit into
developfrom
xgouchet/adjust_metric_sampling_rate

Conversation

@xgouchet

Copy link
Copy Markdown
Contributor

What does this PR do?

Adjust the metrics sampling rate, to ensure we have consistent data across platforms, and don't overwhelm our intake.

@xgouchet
xgouchet requested review from a team as code owners January 23, 2025 14:53
@codecov-commenter

codecov-commenter commented Jan 23, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.97%. Comparing base (1424c51) to head (5c96c49).
Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2490      +/-   ##
===========================================
+ Coverage    69.88%   69.97%   +0.09%     
===========================================
  Files          788      788              
  Lines        29647    29647              
  Branches      4961     4961              
===========================================
+ Hits         20717    20745      +28     
+ Misses        7548     7526      -22     
+ Partials      1382     1376       -6     
Files with missing lines Coverage Δ
...id/core/internal/metrics/BatchMetricsDispatcher.kt 95.95% <100.00%> (ø)
...um/internal/metric/SessionEndedMetricDispatcher.kt 64.52% <100.00%> (ø)

... and 34 files with indirect coverage changes

internalLogger.logMetric(
messageBuilder = { BATCH_DELETED_MESSAGE },
additionalProperties = it,
samplingRate = MethodCallSamplingRate.LOW.rate

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this will increase the volume by 15x times, is it expected?

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.

Yep, this is to align with iOS metrics

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

By looking on the volume for the "Batch Closed" telemetry for the latest SDK releases (2.17.0 for Android, 2.22.0 for iOS) the difference is like 8x, but only 3x for the 2.16.0 vs 2.21.0, so probably increasing this by 15x will create big disparity (and maybe this value should be lowered on iOS?), but if the goal is to have the same effective sampling rate between the 2 platforms, I'm fine with this change.

@xgouchet
xgouchet requested a review from 0xnm January 23, 2025 16:13
messageBuilder = { BATCH_DELETED_MESSAGE },
additionalProperties = it,
samplingRate = MethodCallSamplingRate.LOW.rate
samplingRate = 1.5f

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For the other sampling rates we've used values from MethodCallSamplingRate. Do we not want to add an additional value there for this rate (do we not expect 1.5f to be reused)?

@xgouchet
xgouchet merged commit 6bf92cc into develop Jan 27, 2025
@xgouchet
xgouchet deleted the xgouchet/adjust_metric_sampling_rate branch January 27, 2025 09:16
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.

4 participants