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

Render HTTP header tags as comma-separated strings #1295

Merged
merged 5 commits into from
Mar 23, 2023

Conversation

wjrogers
Copy link
Contributor

Which problem is this PR solving?

Resolves #1294

Short description of the changes

Change formatValue to check whether the (de-serialized) value is an array and, if so, whether the key should be rendered as a comma-separated list of strings. When both conditions are true, render the value like so:

<div class="json-markup">
  <span class="json-markup-string">value1</span>, <span class="json-markup-string">value2</span>
</div>

image

Currently, tag keys starting with http.request.header. and http.response.header. render as string lists. Please let me know if there are any other attributes I should include.

Signed-off-by: Will Rogers <wjrogers@gmail.com>
@wjrogers wjrogers force-pushed the feature-otel-array-tags-#1294 branch from 3f848da to 466a41c Compare March 23, 2023 04:35
expect(valueDiv.html()).toMatch(data[i].expected);
}
});
});

it('renders HTTP headers as multiple string spans', () => {
Copy link
Member

Choose a reason for hiding this comment

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

This test feels very complicated & hard to maintain. Could we not use the .expected field above to define the exact output we want for the two new test cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I was figuring out how the tests work and maybe got carried away. Will change it.

Signed-off-by: Will Rogers <wjrogers@gmail.com>
Signed-off-by: Will Rogers <wjrogers@gmail.com>
@wjrogers wjrogers requested review from yurishkuro and removed request for tiffon, everett980 and rubenvp8510 March 23, 2023 13:51
yurishkuro
yurishkuro previously approved these changes Mar 23, 2023
Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

👍

@yurishkuro yurishkuro enabled auto-merge (squash) March 23, 2023 16:39
@yurishkuro
Copy link
Member

please run the linter, yarn prettier

Signed-off-by: Will Rogers <wjrogers@gmail.com>
auto-merge was automatically disabled March 23, 2023 19:14

Head branch was pushed to by a user without write access

@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.16 🎉

Comparison is base (c1511b7) 95.38% compared to head (31e58d7) 95.54%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1295      +/-   ##
==========================================
+ Coverage   95.38%   95.54%   +0.16%     
==========================================
  Files         244      244              
  Lines        7641     7651      +10     
  Branches     2003     2006       +3     
==========================================
+ Hits         7288     7310      +22     
+ Misses        353      341      -12     
Impacted Files Coverage Δ
.../TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx 97.82% <100.00%> (+0.60%) ⬆️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@yurishkuro yurishkuro merged commit 590cf8c into jaegertracing:main Mar 23, 2023
@wjrogers wjrogers deleted the feature-otel-array-tags-#1294 branch March 24, 2023 14:23
Binrix pushed a commit to Binrix/jaeger-ui that referenced this pull request Apr 18, 2023
## Which problem is this PR solving?

Resolves jaegertracing#1294

## Short description of the changes

Change `formatValue` to check whether the (de-serialized) value is an
array and, if so, whether the key should be rendered as a
comma-separated list of strings. When both conditions are true, render
the value like so:

```html
<div class="json-markup">
  <span class="json-markup-string">value1</span>, <span class="json-markup-string">value2</span>
</div>
```

![image](https://user-images.githubusercontent.com/62573/227103539-aeaf81cd-d5e3-4d4e-a878-f4f68a1503e8.png)

Currently, tag keys starting with `http.request.header.` and
`http.response.header.` render as string lists. Please let me know if
there are any other attributes I should include.

---------

Signed-off-by: Will Rogers <wjrogers@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
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.

[Feature]: Better rendering of OTEL array attributes (e.g. HTTP headers)
2 participants