httpSamplesPanel.tsx 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. import {Fragment, useCallback} from 'react';
  2. import styled from '@emotion/styled';
  3. import * as qs from 'query-string';
  4. import Feature from 'sentry/components/acl/feature';
  5. import ProjectAvatar from 'sentry/components/avatar/projectAvatar';
  6. import {Button} from 'sentry/components/button';
  7. import {CompactSelect} from 'sentry/components/compactSelect';
  8. import SearchBar from 'sentry/components/events/searchBar';
  9. import Link from 'sentry/components/links/link';
  10. import {SegmentedControl} from 'sentry/components/segmentedControl';
  11. import {t} from 'sentry/locale';
  12. import {space} from 'sentry/styles/space';
  13. import {trackAnalytics} from 'sentry/utils/analytics';
  14. import {DurationUnit, RateUnit} from 'sentry/utils/discover/fields';
  15. import {DiscoverDatasets} from 'sentry/utils/discover/types';
  16. import {PageAlertProvider} from 'sentry/utils/performance/contexts/pageAlert';
  17. import {decodeScalar} from 'sentry/utils/queryString';
  18. import {
  19. EMPTY_OPTION_VALUE,
  20. escapeFilterValue,
  21. MutableSearch,
  22. } from 'sentry/utils/tokenizeSearch';
  23. import useLocationQuery from 'sentry/utils/url/useLocationQuery';
  24. import {useLocation} from 'sentry/utils/useLocation';
  25. import useOrganization from 'sentry/utils/useOrganization';
  26. import usePageFilters from 'sentry/utils/usePageFilters';
  27. import useProjects from 'sentry/utils/useProjects';
  28. import useRouter from 'sentry/utils/useRouter';
  29. import {normalizeUrl} from 'sentry/utils/withDomainRequired';
  30. import {AverageValueMarkLine} from 'sentry/views/performance/charts/averageValueMarkLine';
  31. import {DurationChart} from 'sentry/views/performance/http/charts/durationChart';
  32. import {ResponseCodeCountChart} from 'sentry/views/performance/http/charts/responseCodeCountChart';
  33. import {HTTP_RESPONSE_STATUS_CODES} from 'sentry/views/performance/http/data/definitions';
  34. import {useSpanSamples} from 'sentry/views/performance/http/data/useSpanSamples';
  35. import decodePanel from 'sentry/views/performance/http/queryParameterDecoders/panel';
  36. import decodeResponseCodeClass from 'sentry/views/performance/http/queryParameterDecoders/responseCodeClass';
  37. import {Referrer} from 'sentry/views/performance/http/referrers';
  38. import {BASE_FILTERS} from 'sentry/views/performance/http/settings';
  39. import {SpanSamplesTable} from 'sentry/views/performance/http/tables/spanSamplesTable';
  40. import {useDebouncedState} from 'sentry/views/performance/http/useDebouncedState';
  41. import {MetricReadout} from 'sentry/views/performance/metricReadout';
  42. import * as ModuleLayout from 'sentry/views/performance/moduleLayout';
  43. import {useSpanFieldSupportedTags} from 'sentry/views/performance/utils/useSpanFieldSupportedTags';
  44. import {computeAxisMax} from 'sentry/views/starfish/components/chart';
  45. import DetailPanel from 'sentry/views/starfish/components/detailPanel';
  46. import {getTimeSpentExplanation} from 'sentry/views/starfish/components/tableCells/timeSpentCell';
  47. import {useSpanMetrics, useSpansIndexed} from 'sentry/views/starfish/queries/useDiscover';
  48. import {useSpanMetricsSeries} from 'sentry/views/starfish/queries/useDiscoverSeries';
  49. import {useSpanMetricsTopNSeries} from 'sentry/views/starfish/queries/useSpanMetricsTopNSeries';
  50. import {
  51. ModuleName,
  52. SpanFunction,
  53. SpanIndexedField,
  54. SpanMetricsField,
  55. type SpanMetricsQueryFilters,
  56. } from 'sentry/views/starfish/types';
  57. import {findSampleFromDataPoint} from 'sentry/views/starfish/utils/chart/findDataPoint';
  58. import {DataTitles, getThroughputTitle} from 'sentry/views/starfish/views/spans/types';
  59. import {useSampleScatterPlotSeries} from 'sentry/views/starfish/views/spanSummaryPage/sampleList/durationChart/useSampleScatterPlotSeries';
  60. export function HTTPSamplesPanel() {
  61. const router = useRouter();
  62. const location = useLocation();
  63. const query = useLocationQuery({
  64. fields: {
  65. project: decodeScalar,
  66. domain: decodeScalar,
  67. transaction: decodeScalar,
  68. transactionMethod: decodeScalar,
  69. panel: decodePanel,
  70. responseCodeClass: decodeResponseCodeClass,
  71. spanSearchQuery: decodeScalar,
  72. },
  73. });
  74. const organization = useOrganization();
  75. const {projects} = useProjects();
  76. const {selection} = usePageFilters();
  77. const supportedTags = useSpanFieldSupportedTags();
  78. const project = projects.find(p => query.project === p.id);
  79. const [highlightedSpanId, setHighlightedSpanId] = useDebouncedState<string | undefined>(
  80. undefined,
  81. [],
  82. SAMPLE_HOVER_DEBOUNCE
  83. );
  84. // `detailKey` controls whether the panel is open. If all required properties are available, concat them to make a key, otherwise set to `undefined` and hide the panel
  85. const detailKey = query.transaction
  86. ? [query.domain, query.transactionMethod, query.transaction].filter(Boolean).join(':')
  87. : undefined;
  88. const handlePanelChange = newPanelName => {
  89. trackAnalytics('performance_views.sample_spans.filter_updated', {
  90. filter: 'panel',
  91. new_state: newPanelName,
  92. organization,
  93. source: ModuleName.HTTP,
  94. });
  95. router.replace({
  96. pathname: location.pathname,
  97. query: {
  98. ...location.query,
  99. panel: newPanelName,
  100. },
  101. });
  102. };
  103. const handleResponseCodeClassChange = newResponseCodeClass => {
  104. trackAnalytics('performance_views.sample_spans.filter_updated', {
  105. filter: 'status_code',
  106. new_state: newResponseCodeClass.value,
  107. organization,
  108. source: ModuleName.HTTP,
  109. });
  110. router.replace({
  111. pathname: location.pathname,
  112. query: {
  113. ...location.query,
  114. responseCodeClass: newResponseCodeClass.value,
  115. },
  116. });
  117. };
  118. const isPanelOpen = Boolean(detailKey);
  119. // The ribbon is above the data selectors, and not affected by them. So, it has its own filters.
  120. const ribbonFilters: SpanMetricsQueryFilters = {
  121. ...BASE_FILTERS,
  122. 'span.domain':
  123. query.domain === '' ? EMPTY_OPTION_VALUE : escapeFilterValue(query.domain),
  124. transaction: query.transaction,
  125. };
  126. // These filters are for the charts and samples tables
  127. const filters: SpanMetricsQueryFilters = {
  128. ...BASE_FILTERS,
  129. 'span.domain':
  130. query.domain === '' ? EMPTY_OPTION_VALUE : escapeFilterValue(query.domain),
  131. transaction: query.transaction,
  132. };
  133. const responseCodeInRange = query.responseCodeClass
  134. ? Object.keys(HTTP_RESPONSE_STATUS_CODES).filter(code =>
  135. code.startsWith(query.responseCodeClass)
  136. )
  137. : [];
  138. if (responseCodeInRange.length > 0) {
  139. // TODO: Allow automatic array parameter concatenation
  140. filters['span.status_code'] = `[${responseCodeInRange.join(',')}]`;
  141. }
  142. const search = MutableSearch.fromQueryObject(filters);
  143. const {
  144. data: domainTransactionMetrics,
  145. isFetching: areDomainTransactionMetricsFetching,
  146. } = useSpanMetrics(
  147. {
  148. search: MutableSearch.fromQueryObject(ribbonFilters),
  149. fields: [
  150. `${SpanFunction.SPM}()`,
  151. `avg(${SpanMetricsField.SPAN_SELF_TIME})`,
  152. `sum(${SpanMetricsField.SPAN_SELF_TIME})`,
  153. 'http_response_rate(3)',
  154. 'http_response_rate(4)',
  155. 'http_response_rate(5)',
  156. `${SpanFunction.TIME_SPENT_PERCENTAGE}()`,
  157. ],
  158. enabled: isPanelOpen,
  159. },
  160. Referrer.SAMPLES_PANEL_METRICS_RIBBON
  161. );
  162. const {
  163. isFetching: isDurationDataFetching,
  164. data: durationData,
  165. error: durationError,
  166. } = useSpanMetricsSeries(
  167. {
  168. search,
  169. yAxis: [`avg(span.self_time)`],
  170. enabled: isPanelOpen && query.panel === 'duration',
  171. },
  172. Referrer.SAMPLES_PANEL_DURATION_CHART
  173. );
  174. const {
  175. isFetching: isResponseCodeDataLoading,
  176. data: responseCodeData,
  177. error: responseCodeError,
  178. } = useSpanMetricsTopNSeries({
  179. search,
  180. fields: ['span.status_code', 'count()'],
  181. yAxis: ['count()'],
  182. topEvents: 5,
  183. enabled: isPanelOpen && query.panel === 'status',
  184. referrer: Referrer.SAMPLES_PANEL_RESPONSE_CODE_CHART,
  185. });
  186. // NOTE: Due to some data confusion, the `domain` column in the spans table can either be `null` or `""`. Searches like `"!has:span.domain"` are turned into the ClickHouse clause `isNull(domain)`, and do not match the empty string. We need a query that matches empty strings _and_ null_ which is `(!has:domain OR domain:[""])`. This hack can be removed in August 2024, once https://github.com/getsentry/snuba/pull/5780 has been deployed for 90 days and all `""` domains have fallen out of the data retention window. Also, `null` domains will become more rare as people upgrade the JS SDK to versions that populate the `server.address` span attribute
  187. const sampleSpansSearch = MutableSearch.fromQueryObject({
  188. ...filters,
  189. 'span.domain': undefined,
  190. });
  191. // filter by key-value filters specified in the search bar query
  192. sampleSpansSearch.addStringMultiFilter(query.spanSearchQuery);
  193. if (query.domain === '') {
  194. sampleSpansSearch.addOp('(');
  195. sampleSpansSearch.addFilterValue('!has', 'span.domain');
  196. sampleSpansSearch.addOp('OR');
  197. // HACK: Use `addOp` to add the condition `'span.domain:[""]'` and avoid escaping the double quotes. Ideally there'd be a way to specify this explicitly, but this whole thing is a hack anyway. Once a plain `!has:span.domain` condition works, this is not necessary
  198. sampleSpansSearch.addOp('span.domain:[""]');
  199. sampleSpansSearch.addOp(')');
  200. } else {
  201. sampleSpansSearch.addFilterValue('span.domain', query.domain);
  202. }
  203. const durationAxisMax = computeAxisMax([durationData?.[`avg(span.self_time)`]]);
  204. const {
  205. data: durationSamplesData,
  206. isFetching: isDurationSamplesDataFetching,
  207. error: durationSamplesDataError,
  208. refetch: refetchDurationSpanSamples,
  209. } = useSpanSamples({
  210. search: sampleSpansSearch,
  211. fields: [
  212. SpanIndexedField.TRACE,
  213. SpanIndexedField.TRANSACTION_ID,
  214. SpanIndexedField.SPAN_DESCRIPTION,
  215. SpanIndexedField.RESPONSE_CODE,
  216. ],
  217. min: 0,
  218. max: durationAxisMax,
  219. enabled: isPanelOpen && query.panel === 'duration' && durationAxisMax > 0,
  220. referrer: Referrer.SAMPLES_PANEL_DURATION_SAMPLES,
  221. });
  222. const {
  223. data: responseCodeSamplesData,
  224. isFetching: isResponseCodeSamplesDataFetching,
  225. error: responseCodeSamplesDataError,
  226. refetch: refetchResponseCodeSpanSamples,
  227. } = useSpansIndexed(
  228. {
  229. search: sampleSpansSearch,
  230. fields: [
  231. SpanIndexedField.PROJECT,
  232. SpanIndexedField.TRACE,
  233. SpanIndexedField.TRANSACTION_ID,
  234. SpanIndexedField.ID,
  235. SpanIndexedField.TIMESTAMP,
  236. SpanIndexedField.SPAN_DESCRIPTION,
  237. SpanIndexedField.RESPONSE_CODE,
  238. ],
  239. sorts: [SPAN_SAMPLES_SORT],
  240. limit: SPAN_SAMPLE_LIMIT,
  241. enabled: isPanelOpen && query.panel === 'status',
  242. },
  243. Referrer.SAMPLES_PANEL_RESPONSE_CODE_SAMPLES
  244. );
  245. const sampledSpanDataSeries = useSampleScatterPlotSeries(
  246. durationSamplesData,
  247. domainTransactionMetrics?.[0]?.['avg(span.self_time)'],
  248. highlightedSpanId
  249. );
  250. const handleSearch = (newSpanSearchQuery: string) => {
  251. router.replace({
  252. pathname: location.pathname,
  253. query: {
  254. ...query,
  255. spanSearchQuery: newSpanSearchQuery,
  256. },
  257. });
  258. };
  259. const handleClose = () => {
  260. router.replace({
  261. pathname: router.location.pathname,
  262. query: {
  263. ...router.location.query,
  264. transaction: undefined,
  265. transactionMethod: undefined,
  266. },
  267. });
  268. };
  269. const handleOpen = useCallback(() => {
  270. if (query.transaction) {
  271. trackAnalytics('performance_views.sample_spans.opened', {
  272. organization,
  273. source: ModuleName.HTTP,
  274. });
  275. }
  276. }, [organization, query.transaction]);
  277. return (
  278. <PageAlertProvider>
  279. <DetailPanel detailKey={detailKey} onClose={handleClose} onOpen={handleOpen}>
  280. <ModuleLayout.Layout>
  281. <ModuleLayout.Full>
  282. <HeaderContainer>
  283. {project && (
  284. <SpanSummaryProjectAvatar
  285. project={project}
  286. direction="left"
  287. size={40}
  288. hasTooltip
  289. tooltip={project.slug}
  290. />
  291. )}
  292. <Title>
  293. <Link
  294. to={normalizeUrl(
  295. `/organizations/${organization.slug}/performance/summary?${qs.stringify(
  296. {
  297. project: query.project,
  298. transaction: query.transaction,
  299. }
  300. )}`
  301. )}
  302. >
  303. {query.transaction &&
  304. query.transactionMethod &&
  305. !query.transaction.startsWith(query.transactionMethod)
  306. ? `${query.transactionMethod} ${query.transaction}`
  307. : query.transaction}
  308. </Link>
  309. </Title>
  310. </HeaderContainer>
  311. </ModuleLayout.Full>
  312. <ModuleLayout.Full>
  313. <MetricsRibbon>
  314. <MetricReadout
  315. align="left"
  316. title={getThroughputTitle('http')}
  317. value={domainTransactionMetrics?.[0]?.[`${SpanFunction.SPM}()`]}
  318. unit={RateUnit.PER_MINUTE}
  319. isLoading={areDomainTransactionMetricsFetching}
  320. />
  321. <MetricReadout
  322. align="left"
  323. title={DataTitles.avg}
  324. value={
  325. domainTransactionMetrics?.[0]?.[
  326. `avg(${SpanMetricsField.SPAN_SELF_TIME})`
  327. ]
  328. }
  329. unit={DurationUnit.MILLISECOND}
  330. isLoading={areDomainTransactionMetricsFetching}
  331. />
  332. <MetricReadout
  333. align="left"
  334. title={t('3XXs')}
  335. value={domainTransactionMetrics?.[0]?.[`http_response_rate(3)`]}
  336. unit="percentage"
  337. isLoading={areDomainTransactionMetricsFetching}
  338. />
  339. <MetricReadout
  340. align="left"
  341. title={t('4XXs')}
  342. value={domainTransactionMetrics?.[0]?.[`http_response_rate(4)`]}
  343. unit="percentage"
  344. isLoading={areDomainTransactionMetricsFetching}
  345. />
  346. <MetricReadout
  347. align="left"
  348. title={t('5XXs')}
  349. value={domainTransactionMetrics?.[0]?.[`http_response_rate(5)`]}
  350. unit="percentage"
  351. isLoading={areDomainTransactionMetricsFetching}
  352. />
  353. <MetricReadout
  354. align="left"
  355. title={DataTitles.timeSpent}
  356. value={domainTransactionMetrics?.[0]?.['sum(span.self_time)']}
  357. unit={DurationUnit.MILLISECOND}
  358. tooltip={getTimeSpentExplanation(
  359. domainTransactionMetrics?.[0]?.['time_spent_percentage()'],
  360. 'http.client'
  361. )}
  362. isLoading={areDomainTransactionMetricsFetching}
  363. />
  364. </MetricsRibbon>
  365. </ModuleLayout.Full>
  366. <ModuleLayout.Full>
  367. <PanelControls>
  368. <SegmentedControl
  369. value={query.panel}
  370. onChange={handlePanelChange}
  371. aria-label={t('Choose breakdown type')}
  372. >
  373. <SegmentedControl.Item key="duration">
  374. {t('By Duration')}
  375. </SegmentedControl.Item>
  376. <SegmentedControl.Item key="status">
  377. {t('By Response Code')}
  378. </SegmentedControl.Item>
  379. </SegmentedControl>
  380. <CompactSelect
  381. value={query.responseCodeClass}
  382. options={HTTP_RESPONSE_CODE_CLASS_OPTIONS}
  383. onChange={handleResponseCodeClassChange}
  384. triggerProps={{
  385. prefix: t('Response Code'),
  386. }}
  387. />
  388. </PanelControls>
  389. </ModuleLayout.Full>
  390. {query.panel === 'duration' && (
  391. <Fragment>
  392. <ModuleLayout.Full>
  393. <DurationChart
  394. series={[
  395. {
  396. ...durationData[`avg(span.self_time)`],
  397. markLine: AverageValueMarkLine(),
  398. },
  399. ]}
  400. scatterPlot={sampledSpanDataSeries}
  401. onHighlight={highlights => {
  402. const firstHighlight = highlights[0];
  403. if (!firstHighlight) {
  404. setHighlightedSpanId(undefined);
  405. return;
  406. }
  407. const sample = findSampleFromDataPoint<
  408. (typeof durationSamplesData)[0]
  409. >(
  410. firstHighlight.dataPoint,
  411. durationSamplesData,
  412. SpanIndexedField.SPAN_SELF_TIME
  413. );
  414. setHighlightedSpanId(sample?.span_id);
  415. }}
  416. isLoading={isDurationDataFetching}
  417. error={durationError}
  418. />
  419. </ModuleLayout.Full>
  420. </Fragment>
  421. )}
  422. {query.panel === 'status' && (
  423. <Fragment>
  424. <ModuleLayout.Full>
  425. <ResponseCodeCountChart
  426. series={Object.values(responseCodeData).filter(Boolean)}
  427. isLoading={isResponseCodeDataLoading}
  428. error={responseCodeError}
  429. />
  430. </ModuleLayout.Full>
  431. </Fragment>
  432. )}
  433. <Feature features="performance-sample-panel-search">
  434. <ModuleLayout.Full>
  435. <SearchBar
  436. searchSource={`${ModuleName.HTTP}-sample-panel`}
  437. query={query.spanSearchQuery}
  438. onSearch={handleSearch}
  439. placeholder={t('Search for span attributes')}
  440. organization={organization}
  441. metricAlert={false}
  442. supportedTags={supportedTags}
  443. dataset={DiscoverDatasets.SPANS_INDEXED}
  444. projectIds={selection.projects}
  445. />
  446. </ModuleLayout.Full>
  447. </Feature>
  448. {query.panel === 'duration' && (
  449. <Fragment>
  450. <ModuleLayout.Full>
  451. <SpanSamplesTable
  452. data={durationSamplesData}
  453. isLoading={isDurationDataFetching || isDurationSamplesDataFetching}
  454. highlightedSpanId={highlightedSpanId}
  455. onSampleMouseOver={sample => setHighlightedSpanId(sample.span_id)}
  456. onSampleMouseOut={() => setHighlightedSpanId(undefined)}
  457. error={durationSamplesDataError}
  458. // TODO: The samples endpoint doesn't provide its own meta, so we need to create it manually
  459. meta={{
  460. fields: {
  461. 'span.response_code': 'number',
  462. },
  463. units: {},
  464. }}
  465. />
  466. </ModuleLayout.Full>
  467. <ModuleLayout.Full>
  468. <Button
  469. onClick={() => {
  470. trackAnalytics(
  471. 'performance_views.sample_spans.try_different_samples_clicked',
  472. {organization, source: ModuleName.HTTP}
  473. );
  474. refetchDurationSpanSamples();
  475. }}
  476. >
  477. {t('Try Different Samples')}
  478. </Button>
  479. </ModuleLayout.Full>
  480. </Fragment>
  481. )}
  482. {query.panel === 'status' && (
  483. <Fragment>
  484. <ModuleLayout.Full>
  485. <SpanSamplesTable
  486. data={responseCodeSamplesData ?? []}
  487. isLoading={isResponseCodeSamplesDataFetching}
  488. error={responseCodeSamplesDataError}
  489. // TODO: The samples endpoint doesn't provide its own meta, so we need to create it manually
  490. meta={{
  491. fields: {
  492. 'span.response_code': 'number',
  493. },
  494. units: {},
  495. }}
  496. />
  497. </ModuleLayout.Full>
  498. <ModuleLayout.Full>
  499. <Button
  500. onClick={() => {
  501. trackAnalytics(
  502. 'performance_views.sample_spans.try_different_samples_clicked',
  503. {organization, source: ModuleName.HTTP}
  504. );
  505. refetchResponseCodeSpanSamples();
  506. }}
  507. >
  508. {t('Try Different Samples')}
  509. </Button>
  510. </ModuleLayout.Full>
  511. </Fragment>
  512. )}
  513. </ModuleLayout.Layout>
  514. </DetailPanel>
  515. </PageAlertProvider>
  516. );
  517. }
  518. const SAMPLE_HOVER_DEBOUNCE = 10;
  519. const SPAN_SAMPLE_LIMIT = 10;
  520. // This is functionally a random sort, which is what we want
  521. const SPAN_SAMPLES_SORT = {
  522. field: 'span_id',
  523. kind: 'desc' as const,
  524. };
  525. const SpanSummaryProjectAvatar = styled(ProjectAvatar)`
  526. padding-right: ${space(1)};
  527. `;
  528. const HTTP_RESPONSE_CODE_CLASS_OPTIONS = [
  529. {
  530. value: '',
  531. label: t('All'),
  532. },
  533. {
  534. value: '2',
  535. label: t('2XXs'),
  536. },
  537. {
  538. value: '3',
  539. label: t('3XXs'),
  540. },
  541. {
  542. value: '4',
  543. label: t('4XXs'),
  544. },
  545. {
  546. value: '5',
  547. label: t('5XXs'),
  548. },
  549. ];
  550. // TODO - copy of static/app/views/starfish/views/spanSummaryPage/sampleList/index.tsx
  551. const HeaderContainer = styled('div')`
  552. display: grid;
  553. grid-template-rows: auto auto auto;
  554. align-items: center;
  555. @media (min-width: ${p => p.theme.breakpoints.small}) {
  556. grid-template-rows: auto;
  557. grid-template-columns: auto 1fr;
  558. }
  559. `;
  560. const Title = styled('h4')`
  561. overflow: hidden;
  562. text-overflow: ellipsis;
  563. white-space: nowrap;
  564. margin: 0;
  565. `;
  566. const MetricsRibbon = styled('div')`
  567. display: flex;
  568. flex-wrap: wrap;
  569. gap: ${space(4)};
  570. `;
  571. const PanelControls = styled('div')`
  572. display: flex;
  573. justify-content: space-between;
  574. gap: ${space(2)};
  575. `;