-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Adds UI notification for dropped spans #25017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,17 +6,22 @@ | |
|
|
||
| import { | ||
| EuiButtonEmpty, | ||
| EuiCallOut, | ||
| EuiFlexGroup, | ||
| EuiFlexItem, | ||
| EuiFlyout, | ||
| EuiFlyoutBody, | ||
| EuiFlyoutHeader, | ||
| EuiHorizontalRule, | ||
| EuiLink, | ||
| EuiPortal, | ||
| EuiTitle | ||
| } from '@elastic/eui'; | ||
| import { get } from 'lodash'; | ||
| import React from 'react'; | ||
| import styled from 'styled-components'; | ||
| import { IUrlParams } from 'x-pack/plugins/apm/public/store/urlParams'; | ||
| import { APM_AGENT_DROPPED_SPANS_DOCS } from 'x-pack/plugins/apm/public/utils/documentation/agents'; | ||
| import { Transaction } from 'x-pack/plugins/apm/typings/Transaction'; | ||
| import { DiscoverTransactionLink } from '../../../ActionMenu'; | ||
| import { StickyTransactionProperties } from '../../../StickyTransactionProperties'; | ||
|
|
@@ -32,6 +37,61 @@ interface Props { | |
| waterfall: IWaterfall; | ||
| } | ||
|
|
||
| const ResponsiveFlyout = styled(EuiFlyout)` | ||
| width: 100%; | ||
|
|
||
| @media (min-width: 800px) { | ||
| width: 90%; | ||
| } | ||
|
|
||
| @media (min-width: 1000px) { | ||
| width: 70%; | ||
| } | ||
|
|
||
| @media (min-width: 1400px) { | ||
| width: 50%; | ||
| } | ||
|
|
||
| @media (min-width: 2000px) { | ||
| width: 35%; | ||
| } | ||
| `; | ||
|
|
||
| function DroppedSpansWarning({ | ||
| transactionDoc | ||
| }: { | ||
| transactionDoc: Transaction; | ||
| }) { | ||
| const dropped: number = get( | ||
| transactionDoc, | ||
| 'transaction.span_count.dropped.total', | ||
|
||
| 0 | ||
| ); | ||
|
|
||
| if (dropped === 0) { | ||
| return null; | ||
| } | ||
|
|
||
| const url = | ||
| APM_AGENT_DROPPED_SPANS_DOCS[transactionDoc.context.service.agent.name]; | ||
|
|
||
| const docsLink = url ? ( | ||
| <EuiLink href={url} target="_blank"> | ||
| Learn more. | ||
| </EuiLink> | ||
| ) : null; | ||
|
|
||
| return ( | ||
| <React.Fragment> | ||
| <EuiCallOut size="s"> | ||
| The APM agent that reported this transaction dropped {dropped} spans or | ||
| more based on its configuration. {docsLink} | ||
| </EuiCallOut> | ||
| <EuiHorizontalRule /> | ||
| </React.Fragment> | ||
| ); | ||
| } | ||
|
|
||
| export function TransactionFlyout({ | ||
| transaction: transactionDoc, | ||
| onClose, | ||
|
|
@@ -45,7 +105,7 @@ export function TransactionFlyout({ | |
|
|
||
| return ( | ||
| <EuiPortal> | ||
| <EuiFlyout onClose={onClose} size="m" ownFocus={true}> | ||
| <ResponsiveFlyout onClose={onClose} ownFocus={true} maxWidth={false}> | ||
| <EuiFlyoutHeader hasBorder> | ||
| <EuiFlexGroup> | ||
| <EuiFlexItem grow={false}> | ||
|
|
@@ -71,13 +131,14 @@ export function TransactionFlyout({ | |
| totalDuration={waterfall.traceRootDuration} | ||
| /> | ||
| <EuiHorizontalRule /> | ||
| <DroppedSpansWarning transactionDoc={transactionDoc} /> | ||
| <TransactionPropertiesTableForFlyout | ||
| transaction={transactionDoc} | ||
| location={location} | ||
| urlParams={urlParams} | ||
| /> | ||
| </EuiFlyoutBody> | ||
| </EuiFlyout> | ||
| </ResponsiveFlyout> | ||
| </EuiPortal> | ||
| ); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like something that should be part of EUIFlyout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I totally agree.