diff --git a/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/HttpContext.tsx b/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/HttpContext.tsx new file mode 100644 index 0000000000000..2f760adcd4a88 --- /dev/null +++ b/x-pack/plugins/apm/public/components/app/TransactionDetails/Transaction/WaterfallContainer/Waterfall/SpanFlyout/HttpContext.tsx @@ -0,0 +1,47 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React, { Fragment } from 'react'; +import styled from 'styled-components'; +import { + borderRadius, + colors, + fontFamilyCode, + px, + unit, + units +} from '../../../../../../../style/variables'; + +import { EuiTitle } from '@elastic/eui'; +import { HttpContext } from '../../../../../../../../typings/Span'; + +const DatabaseStatement = styled.div` + margin-top: ${px(unit)}; + padding: ${px(units.half)} ${px(unit)}; + background: ${colors.gray5}; + border-radius: ${borderRadius}; + border: 1px solid ${colors.gray4}; + font-family: ${fontFamilyCode}; +`; + +interface Props { + httpContext?: HttpContext; +} + +export function HttpContext({ httpContext }: Props) { + if (!httpContext || !httpContext.url) { + return null; + } + + return ( + + +

HTTP URL

+
+ {httpContext.url} +
+ ); +} 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 7f8b02856aa25..8cfd26ccfb05a 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 @@ -30,6 +30,7 @@ import { px, unit } from '../../../../../../../style/variables'; import Stacktrace from '../../../../../../shared/Stacktrace'; import { DatabaseContext } from './DatabaseContext'; +import { HttpContext } from './HttpContext'; import { StickySpanProperties } from './StickySpanProperties'; import { Transaction } from 'x-pack/plugins/apm/typings/Transaction'; @@ -75,6 +76,7 @@ export function SpanFlyout({ const stackframes = span.span.stacktrace; const codeLanguage: string = get(span, SERVICE_LANGUAGE_NAME); const dbContext = span.context.db; + const httpContext = span.context.http; return ( @@ -99,6 +101,7 @@ export function SpanFlyout({ + diff --git a/x-pack/plugins/apm/typings/Span.ts b/x-pack/plugins/apm/typings/Span.ts index b14a328a85988..db5acee3daaf1 100644 --- a/x-pack/plugins/apm/typings/Span.ts +++ b/x-pack/plugins/apm/typings/Span.ts @@ -18,8 +18,13 @@ interface Processor { event: 'span'; } +export interface HttpContext { + url?: string; +} + interface Context { db?: DbContext; + http?: HttpContext; service: ContextService; [key: string]: any; }