jaegertracing / jaeger-ui

Web UI for Jaeger
http://jaegertracing.io/
Apache License 2.0
1.15k stars 483 forks source link

[Feature]: span.log(attachment) #1354

Open neopaf opened 1 year ago

neopaf commented 1 year ago

Requirement

As a software developer I write external communications of our system to log entries inside span. Information is in binary form, so currently I do it this way: Снимок экрана 2023-04-18 в 17 53 09

To see and analyse this information ideal tool is Wireshark, where same stuff looks like this: Снимок экрана 2023-04-18 в 17 55 53

Currently to open things in Wireshark I need to manually convert that hex to a Wireshark-friendly format:

echo 01000180...6c00| xxd -r -p | od -Ax -tx1 >request.txt

And then open it Снимок экрана 2023-04-18 в 17 57 23

And specify some options, without which Wireshark does not show things right Снимок экрана 2023-04-18 в 17 57 52

This is cumbersome and inconvenient.

I'd like a feature of SOMEHOW be able to log information in binary form, which would ideally be downloadable.

Then I would create .pcap information, including ethernet/ip/tcp headers. And in UI "just click" at "request.pcap", Whireshark would open it, and I (and our Support team) would be very happy to save time analysing stuff.

I feel many users could benefit this.

Problem

Currently I feel the API call allows for anything, but UI probably would not manage binary stuff.

Proposal

API: a way to pass file name and content, options:

  1. add one more overload to JaegerSpan.log
  2. extend existing https://github.com/jaegertracing/jaeger-client-java/blob/428cc390c9f9cac633da7077a9a74a68212177dc/jaeger-core/src/main/java/io/jaegertracing/internal/JaegerSpan.java#L240 to accept fields of a JaegerAttachment type.
  3. do not change API, just if field value is binary... accept it. File name could be just field name.

UI: if log contains binary info, present it as a hyperlink, by clicking on which file is downloaded with a name set in API (see above).

Open questions

No response

neopaf commented 1 year ago

UI option:

<a download=test2.cap href="data:application/data,%3Cscript%3Ealert%28%27hi%27%29%3B%3C%2Fscript%3E">test2.cap</a>

My messages are relatively short, about 600 bytes. This will manage.

yurishkuro commented 1 year ago

I would recommend making use of Link Patterns feature in the UI. You can build a small http service that will do whatever you need with the data, and Jaeger UI will show a link to that service.

Your actual proposal is not feasible, because both OpenTracing API and Java SDK are retired, and even if they were not, the use case is too specific to warrant changes in the logging API.