Skip to content

rabbitmq_tracing should open trace files using UTF-8 for encoding #13952

Open
@pavelbelonosov

Description

@pavelbelonosov

Is your feature request related to a problem? Please describe.

We are using rabbitmq_tracing plugin and faced an issue - when opening log.file from admin->tracing->trace log files we see bad enconding for cyrillic symbols cause no charset is set by default.

Describe the solution you'd like

Maybe you should consider adding js function for opening file in new window:
in tracing.js add ( https://github.com/rabbitmq/rabbitmq-server/blob/main/deps/rabbitmq_tracing/priv/www/js/tracing.js )

function loadTextFile(node, file) {
  fetch('/api/trace-files/node/' + node + '/' + file)
    .then(response => response.text())
    .then(text => {
      const win = window.open();
      win.document.write('<pre style="word-wrap: break-word; white-space: pre-wrap;" >' + text + '</pre>');
    });
}

and in traces.ejs ( https://github.com/rabbitmq/rabbitmq-server/blob/main/deps/rabbitmq_tracing/priv/www/js/tmpl/traces.ejs#L94 )

 <td><a onclick=loadTextFile(<%= node.name %>, <%= file.name %>) ><%= file.name %></a></td>

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions