From 57b189076b8acb071dddc791cdd24f4fbe7b4c04 Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Fri, 26 May 2017 11:32:22 +0200 Subject: [PATCH] Set error span when error is a string value --- src/components/TracePage/TraceTimelineViewer/utils.js | 3 ++- src/components/TracePage/TraceTimelineViewer/utils.test.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/TracePage/TraceTimelineViewer/utils.js b/src/components/TracePage/TraceTimelineViewer/utils.js index 7f0d37bad1..f6cee3ab8b 100644 --- a/src/components/TracePage/TraceTimelineViewer/utils.js +++ b/src/components/TracePage/TraceTimelineViewer/utils.js @@ -104,7 +104,8 @@ export function hasTagKey(tags, key, value) { export const isClientSpan = span => hasTagKey(span.tags, 'span.kind', 'client'); export const isServerSpan = span => hasTagKey(span.tags, 'span.kind', 'server'); -export const isErrorSpan = span => hasTagKey(span.tags, 'error', true); +export const isErrorSpan = span => + hasTagKey(span.tags, 'error', true) || hasTagKey(span.tags, 'error', 'true'); /** * Returns `true` if at least one of the descendants of the `parentSpanIndex` diff --git a/src/components/TracePage/TraceTimelineViewer/utils.test.js b/src/components/TracePage/TraceTimelineViewer/utils.test.js index 227a6eacde..1a00fd33cb 100644 --- a/src/components/TracePage/TraceTimelineViewer/utils.test.js +++ b/src/components/TracePage/TraceTimelineViewer/utils.test.js @@ -94,6 +94,7 @@ const spanTypeTestCases = [ { fn: isClientSpan, name: 'isClientSpan', key: 'span.kind', value: 'client' }, { fn: isServerSpan, name: 'isServerSpan', key: 'span.kind', value: 'server' }, { fn: isErrorSpan, name: 'isErrorSpan', key: 'error', value: true }, + { fn: isErrorSpan, name: 'isErrorSpan', key: 'error', value: 'true' }, ]; spanTypeTestCases.forEach(testCase => {