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

trace url bug fix #281

Merged
merged 4 commits into from
Nov 8, 2021
Merged

trace url bug fix #281

merged 4 commits into from
Nov 8, 2021

Conversation

sarthak77
Copy link
Member

In some of the cases, the full URL was not visible on traces so added conditions to handle that.

@sarthak77 sarthak77 requested review from a team and findingrish November 5, 2021 05:17
@codecov
Copy link

codecov bot commented Nov 5, 2021

Codecov Report

Merging #281 (92e0b7e) into main (0b21b01) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##               main     #281   +/-   ##
=========================================
  Coverage     79.07%   79.07%           
  Complexity     1231     1231           
=========================================
  Files           110      110           
  Lines          4861     4861           
  Branches        440      440           
=========================================
  Hits           3844     3844           
  Misses          813      813           
  Partials        204      204           
Flag Coverage Δ
unit 79.07% <ø> (ø)

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


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 0b21b01...92e0b7e. Read the comment docs.

@github-actions

This comment has been minimized.

@findingrish findingrish requested a review from davexroth November 5, 2021 05:22
@@ -184,7 +184,8 @@ public static boolean isAbsoluteUrl(String urlStr) {
*/
public static Optional<String> getHttpUrlForOTelFormat(
Map<String, AttributeValue> attributeValueMap) {
if (attributeValueMap.containsKey(HTTP_URL.getValue())) {
if (attributeValueMap.containsKey(HTTP_URL.getValue())
&& isAbsoluteUrl(attributeValueMap.get(HTTP_URL.getValue()).getValue())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What if this is not an absolute url but we don't have enough attributes to build the url as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fallback to present case only?

@github-actions

This comment has been minimized.

@@ -196,6 +197,8 @@ public static boolean isAbsoluteUrl(String urlStr) {
attributeValueMap.get(HTTP_HOST.getValue()).getValue(),
attributeValueMap.get(HTTP_TARGET.getValue()).getValue());
return Optional.of(url);
} else if (attributeValueMap.containsKey(HTTP_URL.getValue())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the fallback case, so should have the least priority?

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

@github-actions

This comment has been minimized.

@sarthak77 sarthak77 requested a review from findingrish November 5, 2021 05:40
@@ -202,6 +203,8 @@ public static boolean isAbsoluteUrl(String urlStr) {
} else if (SpanSemanticConventionUtils.isServerSpanForOtelFormat(attributeValueMap)
|| SpanSemanticConventionUtils.isServerSpanForOCFormat(attributeValueMap)) {
return getHttpUrlForOtelFormatServerSpan(attributeValueMap);
} else if (attributeValueMap.containsKey(HTTP_URL.getValue())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

the above two cases would return empty optional, so the final case would not be reachable

Copy link
Member Author

Choose a reason for hiding this comment

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

resolved

@sarthak77 sarthak77 requested a review from findingrish November 6, 2021 03:29
@github-actions

This comment has been minimized.

@sarthak77 sarthak77 merged commit ece2263 into main Nov 8, 2021
@sarthak77 sarthak77 deleted the trace-url-bug-fix branch November 8, 2021 04:52
@github-actions
Copy link

github-actions bot commented Nov 8, 2021

Unit Test Results

  73 files  ±0    73 suites  ±0   1m 7s ⏱️ -1s
387 tests ±0  387 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit ece2263. ± Comparison against base commit 0b21b01.

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.

2 participants