Skip to content

Use lazy initialization of network-related properties in SampleApplication to be able to pick global first party hosts#1218

Merged
0xnm merged 1 commit into
developfrom
nogorodnikov/lazy-initialize-network-related-properties-in-sample-app-to-pick-global-first-party-hosts
Jan 5, 2023
Merged

Use lazy initialization of network-related properties in SampleApplication to be able to pick global first party hosts#1218
0xnm merged 1 commit into
developfrom
nogorodnikov/lazy-initialize-network-related-properties-in-sample-app-to-pick-global-first-party-hosts

Conversation

@0xnm

@0xnm 0xnm commented Jan 5, 2023

Copy link
Copy Markdown
Member

What does this PR do?

Currently properties of SampleApplication are initialized before onCreate method completes, and since DatadogInterceptor/TracingInterceptor resolve global first party host detector at the construction time, it is not available at this moment (because Datadog SDK is not yet initialized), so not resource tracing is available.

This change fixes it by switching to the lazy initialization.

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)

…ation to be able to pick global first party hosts
@0xnm
0xnm requested a review from a team as a code owner January 5, 2023 13:02
@codecov-commenter

codecov-commenter commented Jan 5, 2023

Copy link
Copy Markdown

Codecov Report

Merging #1218 (47f094d) into develop (640dc96) will increase coverage by 0.06%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #1218      +/-   ##
===========================================
+ Coverage    82.30%   82.36%   +0.06%     
===========================================
  Files          353      353              
  Lines        11799    11794       -5     
  Branches      2009     2007       -2     
===========================================
+ Hits          9710     9713       +3     
+ Misses        1474     1473       -1     
+ Partials       615      608       -7     
Impacted Files Coverage Δ
...in/com/datadog/android/log/internal/LogsFeature.kt 87.10% <0.00%> (ø)
...android/rum/internal/ndk/DatadogNdkCrashHandler.kt 87.19% <0.00%> (ø)
...android/v2/core/internal/DatadogContextProvider.kt 81.54% <0.00%> (ø)
.../android/rum/internal/domain/scope/RumViewScope.kt 95.42% <0.00%> (+0.18%) ⬆️
...android/log/internal/domain/DatadogLogGenerator.kt 97.32% <0.00%> (+0.67%) ⬆️
...d/v2/core/internal/storage/FileEventBatchWriter.kt 97.62% <0.00%> (+2.38%) ⬆️
...n/com/datadog/android/v2/core/SdkInternalLogger.kt 88.46% <0.00%> (+3.85%) ⬆️
.../kotlin/com/datadog/android/ktx/tracing/SpanExt.kt 100.00% <0.00%> (+13.33%) ⬆️
...android/log/internal/logger/TelemetryLogHandler.kt 100.00% <0.00%> (+28.57%) ⬆️

@0xnm
0xnm merged commit ab7fb40 into develop Jan 5, 2023
@0xnm
0xnm deleted the nogorodnikov/lazy-initialize-network-related-properties-in-sample-app-to-pick-global-first-party-hosts branch January 5, 2023 14:52
@xgouchet xgouchet added this to the 1.17.0 milestone Dec 13, 2023
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.

5 participants