Skip to content

RUM-1236: Use enum for HTTP method parameter of RumMonitor#startResource API#1653

Merged
0xnm merged 2 commits into
release/2.2.0from
nogorodnikov/rum-1236/use-enum-for-http-method-arg-in-rummonitor-startresource-api
Oct 3, 2023
Merged

RUM-1236: Use enum for HTTP method parameter of RumMonitor#startResource API#1653
0xnm merged 2 commits into
release/2.2.0from
nogorodnikov/rum-1236/use-enum-for-http-method-arg-in-rummonitor-startresource-api

Conversation

@0xnm

@0xnm 0xnm commented Oct 3, 2023

Copy link
Copy Markdown
Member

What does this PR do?

In the RumMonitor#startResource API we accept HTTP methods as String, however this leads to many errors reported in telemetry from customers who try to supply freeform values for this parameter, because they cannot be matched to the RUM Schema enum. It means we also need to use enum, which aligns closer with what iOS has - similar API doesn’t allow freeform HTTP methods and in case of conversion to RUM schema enum fallback to get is used.

It may be some discrepancy if span and RUM resource reported for the same call, because in case of span freeform http.method is allowed and RUM resource expects the value from the enum (so if value cannot be matched, GET will be used), but anyway it is the same what iOS SDK has right now, and at least RUM resource will be reported instead of loosing it due to exception.

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)

@0xnm
0xnm force-pushed the nogorodnikov/rum-1236/use-enum-for-http-method-arg-in-rummonitor-startresource-api branch from 2232fa3 to da88bc3 Compare October 3, 2023 11:39
xgouchet
xgouchet previously approved these changes Oct 3, 2023
@0xnm
0xnm force-pushed the nogorodnikov/rum-1236/use-enum-for-http-method-arg-in-rummonitor-startresource-api branch from da88bc3 to 8374551 Compare October 3, 2023 12:54
@0xnm
0xnm force-pushed the nogorodnikov/rum-1236/use-enum-for-http-method-arg-in-rummonitor-startresource-api branch from 8374551 to 5bcb223 Compare October 3, 2023 12:55
@0xnm
0xnm marked this pull request as ready for review October 3, 2023 12:55
@0xnm
0xnm requested a review from a team as a code owner October 3, 2023 12:55
@0xnm
0xnm requested a review from xgouchet October 3, 2023 13:00

@xgouchet xgouchet left a comment

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.

Good work indeed, this will limit us spamming the telemetry and can help guide the customers in using the proper values

@codecov-commenter

codecov-commenter commented Oct 3, 2023

Copy link
Copy Markdown

Codecov Report

Merging #1653 (5bcb223) into release/2.2.0 (100edc9) will increase coverage by 0.09%.
The diff coverage is 80.00%.

@@                Coverage Diff                @@
##           release/2.2.0    #1653      +/-   ##
=================================================
+ Coverage          83.58%   83.68%   +0.09%     
=================================================
  Files                457      458       +1     
  Lines              15734    15762      +28     
  Branches            2349     2352       +3     
=================================================
+ Hits               13151    13189      +38     
+ Misses              1954     1948       -6     
+ Partials             629      625       -4     
Files Coverage Δ
...otlin/com/datadog/android/rum/RumResourceMethod.kt 100.00% <100.00%> (ø)
...g/android/rum/internal/domain/scope/RumEventExt.kt 93.06% <100.00%> (+0.69%) ⬆️
...g/android/rum/internal/domain/scope/RumRawEvent.kt 100.00% <100.00%> (ø)
...roid/rum/internal/domain/scope/RumResourceScope.kt 95.36% <100.00%> (+0.42%) ⬆️
...dog/android/rum/resource/RumResourceInputStream.kt 92.42% <100.00%> (ø)
...n/com/datadog/android/okhttp/DatadogInterceptor.kt 71.94% <100.00%> (+2.65%) ⬆️
.../main/kotlin/com/datadog/android/rum/RumMonitor.kt 28.57% <0.00%> (-4.76%) ⬇️
.../android/rum/internal/monitor/DatadogRumMonitor.kt 85.13% <40.00%> (-2.27%) ⬇️

... and 16 files with indirect coverage changes

@0xnm
0xnm merged commit d3a3f83 into release/2.2.0 Oct 3, 2023
@0xnm
0xnm deleted the nogorodnikov/rum-1236/use-enum-for-http-method-arg-in-rummonitor-startresource-api branch October 3, 2023 14:40
@xgouchet xgouchet added this to the 2.2.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.

4 participants