From d58003e2ad13c5743dc3c81e4be233331d7adc93 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Tue, 20 Sep 2016 15:00:56 +0800 Subject: [PATCH] Makes it possible to display annotations who are a json value See https://github.com/uber/jaeger-client-go/pull/42/files#diff-0c86eb97f3a2f8a9893cb60c27e21dd7R33 See dfcd6c120436c3a6b341f136dc7c634d78b59f4a --- zipkin-ui/js/component_ui/spanPanel.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zipkin-ui/js/component_ui/spanPanel.js b/zipkin-ui/js/component_ui/spanPanel.js index abc98e23860..47416961896 100644 --- a/zipkin-ui/js/component_ui/spanPanel.js +++ b/zipkin-ui/js/component_ui/spanPanel.js @@ -22,7 +22,10 @@ export default component(function spanPanel() { } $row.find('td').each(function() { const $this = $(this); - $this.text(anno[$this.data('key')]); + const maybeObject = anno[$this.data('key')]; + // In case someone is storing escaped json as an annotation value + // TODO: this class is not testable at the moment + $this.text($.type(maybeObject) === 'object' ? JSON.stringify(maybeObject) : maybeObject); }); $annoBody.append($row); });