Skip to content

RUM-4260 Make CoreTracer code Java 7 compatible#2051

Merged
mariusc83 merged 6 commits into
feature/otel-supportfrom
mconstantin/rum-4260/make-core-tracer-java-7-compatible
May 27, 2024
Merged

RUM-4260 Make CoreTracer code Java 7 compatible#2051
mariusc83 merged 6 commits into
feature/otel-supportfrom
mconstantin/rum-4260/make-core-tracer-java-7-compatible

Conversation

@mariusc83

@mariusc83 mariusc83 commented May 23, 2024

Copy link
Copy Markdown
Member

What does this PR do?

In this PR we are cleaning up the imported Java code for the CoreTracer and make it Java 7 compatible in order to not require desugaring on Android 23 and below.

The are several steps in achieving this:

  • we are adding back the Injectors into the CoreTracer as I realized that we will be needing this later for Context propagation
  • we are replacing the logic where java.util.Base64, java.util.Map, java.util.Stream is being used in order to make it Java 7 compatible
  • for the places where we cannot delete or replace would be too complex we are introducing our own package with substitutes for this lambda functions
  • we are performing more cleaning after and re - enabling the NewApi rule for linting

Have in mind that maybe some more cleaning could be performed but I don't find this idea wise. What I could clean so far was code that I was really certain that it cannot affect the current functionality, it will not have any impact on the APM metrics and will not have repercussions later. We already went into trouble by removing the Injector which seemed not to be used for the moment and I just realized during this PR work that this will have a negative impact later.

Motivation

What inspired you to submit this pull request?

Additional Notes

I performed a Profiling by analyzing the CPU consumption and Memory consumption while using the new Otel code and I could not see any potential issue (spike).

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)

@mariusc83 mariusc83 self-assigned this May 23, 2024
@mariusc83
mariusc83 force-pushed the mconstantin/rum-4260/make-core-tracer-java-7-compatible branch from ffdc515 to c15ef3b Compare May 23, 2024 09:19
@codecov-commenter

codecov-commenter commented May 23, 2024

Copy link
Copy Markdown

Codecov Report

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

Project coverage is 66.82%. Comparing base (ad06c50) to head (da0a254).
Report is 1 commits behind head on feature/otel-support.

Additional details and impacted files
@@                   Coverage Diff                    @@
##           feature/otel-support    #2051      +/-   ##
========================================================
+ Coverage                 64.11%   66.82%   +2.70%     
========================================================
  Files                       759      734      -25     
  Lines                     28307    27197    -1110     
  Branches                   4753     4603     -150     
========================================================
+ Hits                      18148    18172      +24     
+ Misses                     8926     7798    -1128     
+ Partials                   1233     1227       -6     
Files Coverage Δ
...ce/src/main/java/com/datadog/trace/api/Config.java 59.00% <ø> (+12.62%) ⬆️
...main/java/com/datadog/trace/api/DynamicConfig.java 55.75% <ø> (ø)
.../main/java/com/datadog/trace/api/EventTracker.java 0.00% <ø> (ø)
...src/main/java/com/datadog/trace/api/Functions.java 25.00% <ø> (+21.88%) ⬆️
.../main/java/com/datadog/trace/api/GlobalTracer.java 0.00% <ø> (ø)
...ain/java/com/datadog/trace/api/cache/DDCaches.java 100.00% <ø> (+71.43%) ⬆️
...va/com/datadog/trace/api/cache/FixedSizeCache.java 44.44% <ø> (ø)
...va/com/datadog/trace/api/cache/RadixTreeCache.java 0.00% <ø> (ø)
...race/api/experimental/DataStreamsCheckpointer.java 0.00% <ø> (ø)
...ce/api/normalize/AntPatternHttpPathNormalizer.java 0.00% <ø> (ø)
... and 26 more

... and 32 files with indirect coverage changes

@mariusc83
mariusc83 force-pushed the mconstantin/rum-4260/make-core-tracer-java-7-compatible branch from c15ef3b to bfa1fe0 Compare May 23, 2024 09:45
@mariusc83
mariusc83 marked this pull request as ready for review May 23, 2024 11:38
@mariusc83
mariusc83 requested review from a team as code owners May 23, 2024 11:38
0xnm

This comment was marked as off-topic.

@mariusc83
mariusc83 force-pushed the mconstantin/rum-4260/make-core-tracer-java-7-compatible branch 2 times, most recently from db7f966 to c7f4205 Compare May 23, 2024 12:57
@DataDog DataDog deleted a comment from 0xnm May 24, 2024
@DataDog DataDog deleted a comment from 0xnm May 24, 2024
@mariusc83
mariusc83 force-pushed the mconstantin/rum-4260/make-core-tracer-java-7-compatible branch from d758882 to da0a254 Compare May 24, 2024 15:14
@mariusc83
mariusc83 merged commit c81732c into feature/otel-support May 27, 2024
@mariusc83
mariusc83 deleted the mconstantin/rum-4260/make-core-tracer-java-7-compatible branch May 27, 2024 07:38
@xgouchet xgouchet added this to the 2.11.x milestone Jul 31, 2024
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