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

RUMM-2659 editable additional attributes #1089

Merged
merged 4 commits into from
Oct 18, 2022

Conversation

xgouchet
Copy link
Member

What does this PR do?

Allow edition of custom attributes for RUM events.

Motivation

The context's additional attributes were immutable by default, meaning there was no way to edit them within the EventMapper callback.

@xgouchet xgouchet requested a review from a team as a code owner October 17, 2022 13:46
@xgouchet xgouchet changed the title RUMM-2659/editable additional attributes RUMM-2659 editable additional attributes Oct 17, 2022
@xgouchet xgouchet added the size-small This PR is small sized label Oct 17, 2022
@xgouchet xgouchet force-pushed the xgouchet/RUMM-2659/editable_additional_attributes branch from 8847c50 to e80ee0e Compare October 17, 2022 14:44
@plousada
Copy link
Member

I'm not super familiar with the generator but LGTM.

val logWithoutAttributes = fakeLog.copy(additionalProperties = emptyMap())
val attributes = forge.aMap {
val logWithoutAttributes = fakeLog.copy(additionalProperties = mutableMapOf())
val attributes = forge.aMap<String, Any?> {
Copy link
Member

Choose a reason for hiding this comment

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

why explicit type is needed now?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because the compiler can't resolve it

Copy link
Member

Choose a reason for hiding this comment

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

Clear now. I just asked because my IDE was completely fine with removing the type, but after explicit compilation the error was raised indeed.

@codecov-commenter
Copy link

codecov-commenter commented Oct 18, 2022

Codecov Report

Merging #1089 (94730be) into develop (4cdbce3) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop    #1089      +/-   ##
===========================================
- Coverage    83.27%   83.25%   -0.02%     
===========================================
  Files          273      273              
  Lines         9342     9344       +2     
  Branches      1501     1502       +1     
===========================================
  Hits          7779     7779              
- Misses        1146     1149       +3     
+ Partials       417      416       -1     
Impacted Files Coverage Δ
...droid/core/internal/constraints/DataConstraints.kt 75.00% <ø> (ø)
...id/rum/internal/domain/event/RumEventSerializer.kt 99.07% <ø> (ø)
...oid/src/main/kotlin/com/datadog/android/Datadog.kt 81.97% <100.00%> (ø)
...ore/internal/constraints/DatadogDataConstraints.kt 94.67% <100.00%> (+0.07%) ⬆️
...om/datadog/android/core/internal/utils/MapUtils.kt 100.00% <100.00%> (ø)
...id/log/internal/domain/event/LogEventSerializer.kt 95.00% <100.00%> (ø)
...droid/log/internal/user/DatadogUserInfoProvider.kt 100.00% <100.00%> (ø)
...android/rum/internal/ndk/DatadogNdkCrashHandler.kt 89.19% <100.00%> (+1.62%) ⬆️
...acing/internal/domain/event/SpanEventSerializer.kt 90.32% <100.00%> (ø)
...android/log/internal/logger/TelemetryLogHandler.kt 75.00% <0.00%> (-25.00%) ⬇️
... and 6 more

@xgouchet xgouchet merged commit 2b19144 into develop Oct 18, 2022
@xgouchet xgouchet deleted the xgouchet/RUMM-2659/editable_additional_attributes branch October 18, 2022 08:37
@xgouchet xgouchet added this to the 1.15.0 milestone Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size-small This PR is small sized
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants