hypertrace / span-normalizer

A streaming job that converts the incoming spans into Hypertrace's raw span format
Apache License 2.0
0 stars 2 forks source link

Fixes hypertrace/hypertrace-ui#283 - Handle relative URLs to extract out path and query string #33

Closed GurtejSohi closed 3 years ago

GurtejSohi commented 3 years ago

Sometimes, the HTTP URL tags may not contain the full URL - they may only contain a relative URL(or the path). E.g. "/customer?customer=392". In such cases, even though we set the Url field to null, we should be able to extract out the path and the query string, which is what these changes aim to achieve.

codecov[bot] commented 3 years ago

Codecov Report

Merging #33 into main will decrease coverage by 0.22%. The diff coverage is 72.22%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main      #33      +/-   ##
============================================
- Coverage     83.69%   83.47%   -0.23%     
- Complexity      242      244       +2     
============================================
  Files            16       16              
  Lines           828      835       +7     
  Branches         55       58       +3     
============================================
+ Hits            693      697       +4     
- Misses           99      101       +2     
- Partials         36       37       +1     
Flag Coverage Δ Complexity Δ
unit 83.47% <72.22%> (-0.23%) 244.00 <6.00> (+2.00) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
...ormalizer/fieldgenerators/HttpFieldsGenerator.java 95.12% <72.22%> (-0.95%) 96.00 <6.00> (+2.00) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 87a9521...8a0d7c4. Read the comment docs.

kotharironak commented 3 years ago

linking the associated issue - https://github.com/hypertrace/hypertrace-ui/issues/283

GurtejSohi commented 3 years ago

As discussed with @kotharironak and @skjindal93 , using URIs allows a lot of invalid strings. Also, it is not able to parse some some URLs which have encoding/decoding issues (as mentioned here: https://github.com/hypertrace/hypertrace-trace-enricher/pull/42#discussion_r513496972). So, we decided to revert those changes.

For relative URLs(which contain only the path and query string), we decided to not populate the url field but extract out the path and query string and populate them.