signoz icon indicating copy to clipboard operation
signoz copied to clipboard

Human-Readable JSON View for Trace Tags

Open jwillp opened this issue 2 years ago • 1 comments

In Jaeger, when viewing a tag that has a JSON value, the UI formats it in a human-readable form. This is particularly useful for specific tags and quick debugging. Is there any plan to do the same in Signoz?

jwillp avatar Sep 23 '22 19:09 jwillp

Thanks for opening this issue. A team member should give feedback soon. In the meantime, feel free to check out the contributing guidelines.

welcome[bot] avatar Sep 23 '22 19:09 welcome[bot]

@jwillp Can you share some screenshots from Jaeger on what do you mean by human readable form?

pranay01 avatar Nov 03 '22 00:11 pranay01

@pranay01 something like this: image

jwillp avatar Nov 10 '22 17:11 jwillp

+1 for the requst

I wrote following Greasemonkey script as a workaround:

// ==UserScript==
// @name     Signoz JSON Formatter
// @require  http://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js
// @require  https://gist.github.com/raw/2625891/waitForKeyElements.js
// @include /^https:\/\/(apm.dev.example.com|apm.uat.example.com)/*
// @grant    GM_addStyle
// ==/UserScript==

waitForKeyElements ('div.ant-modal-body>div', actionFunction);

function actionFunction (jNode) {
    var json = $('div.ant-modal-body>div').text();
    var data = JSON.parse(json);
    var pretty = JSON.stringify(data, null, '\t');
    jNode.css ("background", "#FAEBD7");
    jNode.css ("color", "black");
    jNode.css ("font-family", "monospace");
    jNode.css ("white-space", "pre-wrap");
    jNode.text(pretty);
}

shariqmus avatar Mar 16 '23 10:03 shariqmus

great issue, came here to create a similar one:) thanks @palashgdev i will check how it looks with my logs

AsoTora avatar Jan 09 '24 11:01 AsoTora