From 8e573a2f7b9783d7566f9207a0f6ab26950ff50c Mon Sep 17 00:00:00 2001 From: Oliver Gupte Date: Mon, 3 Dec 2018 17:48:43 -0800 Subject: [PATCH] [APM] Show tags in span details (#26396) (#26595) * [APM] Show tags in span details * [APM] fixed typo * [APM] remove unused export --- .../Waterfall/SpanFlyout/index.tsx | 58 ++++++++++++++++--- x-pack/plugins/apm/typings/Span.ts | 5 ++ 2 files changed, 56 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/index.tsx b/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/index.tsx index 8cfd26ccfb05..2fdd2dd0ec6e 100644 --- a/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/index.tsx +++ b/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/index.tsx @@ -5,6 +5,7 @@ */ import { + EuiBasicTable, EuiFlexGroup, EuiFlexItem, EuiFlyout, @@ -12,10 +13,12 @@ import { EuiFlyoutHeader, EuiHorizontalRule, EuiPortal, + // @ts-ignore otherwise TS complains "Module ''@elastic/eui'' has no exported member 'EuiTabbedContent'" + EuiTabbedContent, EuiTitle } from '@elastic/eui'; -import { get } from 'lodash'; -import React from 'react'; +import { get, keys } from 'lodash'; +import React, { Fragment } from 'react'; import styled from 'styled-components'; // @ts-ignore @@ -42,6 +45,10 @@ const StackTraceContainer = styled.div` margin-top: ${px(unit)}; `; +const TagName = styled.div` + font-weight: bold; +`; + function getDiscoverQuery(span: Span) { return { _a: { @@ -77,6 +84,7 @@ export function SpanFlyout({ const codeLanguage: string = get(span, SERVICE_LANGUAGE_NAME); const dbContext = span.context.db; const httpContext = span.context.http; + const tagContext = span.context.tags; return ( @@ -101,11 +109,47 @@ export function SpanFlyout({ - - - - - + + + + + + + + ) + }, + { + id: 'tags', + name: 'Tags', + content: ( + + {key} + }, + { field: 'value' } + ]} + items={keys(tagContext).map(key => ({ + key, + value: get(tagContext, key) + }))} + /> + + ) + } + ]} + /> diff --git a/x-pack/plugins/apm/typings/Span.ts b/x-pack/plugins/apm/typings/Span.ts index 5e094967c44b..bb2ba40733c8 100644 --- a/x-pack/plugins/apm/typings/Span.ts +++ b/x-pack/plugins/apm/typings/Span.ts @@ -22,9 +22,14 @@ export interface HttpContext { url?: string; } +interface TagsContext { + [key: string]: string; +} + interface Context { db?: DbContext; http?: HttpContext; + tags?: TagsContext; service: ContextService; [key: string]: unknown; }