Skip to content

Commit

Permalink
Set error span when error is a string value (#32)
Browse files Browse the repository at this point in the history
Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
  • Loading branch information
pavolloffay authored and black-adder committed May 26, 2017
1 parent 1b0c624 commit 1f99b5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/TracePage/TraceTimelineViewer/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
1 change: 1 addition & 0 deletions src/components/TracePage/TraceTimelineViewer/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 1f99b5f

Please sign in to comment.