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

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

Closed
wjrogers opened this issue Mar 22, 2023 · 0 comments · Fixed by #1295
Closed

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

wjrogers opened this issue Mar 22, 2023 · 0 comments · Fixed by #1295

Comments

@wjrogers
Copy link
Contributor

Requirement

As a developer, I want to use Jaeger all-in-one locally while I work, so I can both verify my code is correctly instrumented and also use traces to help with debugging. When I work on HTTP services, I want to include HTTP headers as trace tags to quickly verify correct content negotiation, caching, keep-alive, etc.

Problem

The OpenTelemetry semantic conventions for HTTP request and response headers says:

The attribute value MUST consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers.

Jaeger displays array values as pretty-printed JSON arrays, which isn't well suited to HTTP headers, which rarely have more than one value:

image

Proposal

As a special case for HTTP request and response tags, Jaeger should display the array value as a comma-separated list of un-decorated strings (i.e. no array brackets, no quotes), the same as other HTTP tags like http.user_agent are displayed.

Open questions

No response

@yurishkuro yurishkuro changed the title [Feature]: [Feature]: Better rendering of OTEL array attributes (e.g. HTTP headers) Mar 22, 2023
yurishkuro added a commit to wjrogers/jaeger-ui that referenced this issue Mar 23, 2023
yurishkuro added a commit that referenced this issue Mar 23, 2023
## 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:

```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>
Binrix pushed a commit to Binrix/jaeger-ui that referenced this issue 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants