Skip to content

Collect Locale attributes#2797

Merged
jonathanmos merged 1 commit into
developfrom
jmoskovich/rum-9471/locale-attributes
Jul 28, 2025
Merged

Collect Locale attributes#2797
jonathanmos merged 1 commit into
developfrom
jmoskovich/rum-9471/locale-attributes

Conversation

@jonathanmos

@jonathanmos jonathanmos commented Jul 23, 2025

Copy link
Copy Markdown
Member

What does this PR do?

Collects the following Locale attributes:

currentLocale - the current locale defined for the user or falls back to the device default
locales - an ordered list of locales the user has defined
timeZone - the timeZone of the device

These new attributes are sent within the view, error, action and resource scopes within the application and device categories. A known edge case at the moment is that if the user updates the values of locale or timezone while the sdk is running this change will not be reflected in what we send - the values are set at the time that the context is created and cached. This means that only a restart of the SDK would send updated values. However, users don't often change their timezone or locale settings so this may be an acceptable limitation. The alternative could be to set broadcast receivers for these changes, but that may be overkill.

Motivation

Part of the initiative to collect additional attributes.

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 force-pushed the jmoskovich/update-rumschema branch from ceb2a28 to fbd5b1b Compare July 23, 2025 15:05
@jonathanmos
jonathanmos force-pushed the jmoskovich/rum-9471/locale-attributes branch from 7065056 to 4c3a387 Compare July 23, 2025 15:06
@codecov-commenter

codecov-commenter commented Jul 23, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.81250% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.92%. Comparing base (fbd5b1b) to head (6182a2d).
⚠️ Report is 1882 commits behind head on develop.

Files with missing lines Patch % Lines
...core/internal/system/DefaultAndroidInfoProvider.kt 70.00% 1 Missing and 5 partials ⚠️
...tadog/android/core/internal/NoOpContextProvider.kt 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2797      +/-   ##
===========================================
+ Coverage    69.84%   69.92%   +0.07%     
===========================================
  Files          831      832       +1     
  Lines        31138    31191      +53     
  Branches      5234     5242       +8     
===========================================
+ Hits         21748    21808      +60     
+ Misses        7913     7908       -5     
+ Partials      1477     1475       -2     
Files with missing lines Coverage Δ
...tlin/com/datadog/android/api/context/DeviceInfo.kt 100.00% <100.00%> (ø)
...tlin/com/datadog/android/api/context/LocaleInfo.kt 100.00% <100.00%> (ø)
...og/android/core/internal/DatadogContextProvider.kt 100.00% <100.00%> (ø)
...id/core/internal/system/NoOpAndroidInfoProvider.kt 92.86% <100.00%> (+1.95%) ⬆️
...ndroid/rum/internal/domain/scope/RumActionScope.kt 96.94% <100.00%> (+0.06%) ⬆️
...roid/rum/internal/domain/scope/RumResourceScope.kt 94.12% <100.00%> (+0.41%) ⬆️
.../android/rum/internal/domain/scope/RumViewScope.kt 93.89% <100.00%> (-0.06%) ⬇️
...tadog/android/core/internal/NoOpContextProvider.kt 2.22% <0.00%> (-0.22%) ⬇️
...core/internal/system/DefaultAndroidInfoProvider.kt 80.26% <70.00%> (-3.67%) ⬇️

... and 30 files with indirect coverage changes

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

@jonathanmos
jonathanmos force-pushed the jmoskovich/rum-9471/locale-attributes branch from 4c3a387 to c5dd9a9 Compare July 23, 2025 15:44
@danielgomezrico danielgomezrico mentioned this pull request Jul 23, 2025
@jonathanmos
jonathanmos force-pushed the jmoskovich/rum-9471/locale-attributes branch from c5dd9a9 to 59a61cb Compare July 24, 2025 11:54
@jonathanmos
jonathanmos force-pushed the jmoskovich/rum-9471/locale-attributes branch from 59a61cb to 6182a2d Compare July 24, 2025 12:15
@jonathanmos
jonathanmos marked this pull request as ready for review July 24, 2025 13:23
@jonathanmos
jonathanmos requested review from a team as code owners July 24, 2025 13:23
* @property timeZone The device’s current time zone identifier, e.g. 'Europe/Berlin'.
*/
data class LocaleInfo(
val locales: List<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.

do elements of locales have the same meaning as currentLocale? Can es-FR be in locales?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes, locales is an array of the currently set values in the same format. For example:

["en-US", "he-IL"]

Base automatically changed from jmoskovich/update-rumschema to develop July 28, 2025 08:57
@jonathanmos
jonathanmos merged commit 84e8e68 into develop Jul 28, 2025
24 checks passed
@jonathanmos
jonathanmos deleted the jmoskovich/rum-9471/locale-attributes branch July 28, 2025 11:29
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