httpSamplesPanel.tsx 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  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. <TitleContainer>
  293. <Title>
  294. <Link
  295. to={normalizeUrl(
  296. `/organizations/${organization.slug}/performance/summary?${qs.stringify(
  297. {
  298. project: query.project,
  299. transaction: query.transaction,
  300. }
  301. )}`
  302. )}
  303. >
  304. {query.transaction &&
  305. query.transactionMethod &&
  306. !query.transaction.startsWith(query.transactionMethod)
  307. ? `${query.transactionMethod} ${query.transaction}`
  308. : query.transaction}
  309. </Link>
  310. </Title>
  311. </TitleContainer>
  312. </HeaderContainer>
  313. </ModuleLayout.Full>
  314. <ModuleLayout.Full>
  315. <MetricsRibbon>
  316. <MetricReadout
  317. align="left"
  318. title={getThroughputTitle('http')}
  319. value={domainTransactionMetrics?.[0]?.[`${SpanFunction.SPM}()`]}
  320. unit={RateUnit.PER_MINUTE}
  321. isLoading={areDomainTransactionMetricsFetching}
  322. />
  323. <MetricReadout
  324. align="left"
  325. title={DataTitles.avg}
  326. value={
  327. domainTransactionMetrics?.[0]?.[
  328. `avg(${SpanMetricsField.SPAN_SELF_TIME})`
  329. ]
  330. }
  331. unit={DurationUnit.MILLISECOND}
  332. isLoading={areDomainTransactionMetricsFetching}
  333. />
  334. <MetricReadout
  335. align="left"
  336. title={t('3XXs')}
  337. value={domainTransactionMetrics?.[0]?.[`http_response_rate(3)`]}
  338. unit="percentage"
  339. isLoading={areDomainTransactionMetricsFetching}
  340. />
  341. <MetricReadout
  342. align="left"
  343. title={t('4XXs')}
  344. value={domainTransactionMetrics?.[0]?.[`http_response_rate(4)`]}
  345. unit="percentage"
  346. isLoading={areDomainTransactionMetricsFetching}
  347. />
  348. <MetricReadout
  349. align="left"
  350. title={t('5XXs')}
  351. value={domainTransactionMetrics?.[0]?.[`http_response_rate(5)`]}
  352. unit="percentage"
  353. isLoading={areDomainTransactionMetricsFetching}
  354. />
  355. <MetricReadout
  356. align="left"
  357. title={DataTitles.timeSpent}
  358. value={domainTransactionMetrics?.[0]?.['sum(span.self_time)']}
  359. unit={DurationUnit.MILLISECOND}
  360. tooltip={getTimeSpentExplanation(
  361. domainTransactionMetrics?.[0]?.['time_spent_percentage()'],
  362. 'http.client'
  363. )}
  364. isLoading={areDomainTransactionMetricsFetching}
  365. />
  366. </MetricsRibbon>
  367. </ModuleLayout.Full>
  368. <ModuleLayout.Full>
  369. <PanelControls>
  370. <SegmentedControl
  371. value={query.panel}
  372. onChange={handlePanelChange}
  373. aria-label={t('Choose breakdown type')}
  374. >
  375. <SegmentedControl.Item key="duration">
  376. {t('By Duration')}
  377. </SegmentedControl.Item>
  378. <SegmentedControl.Item key="status">
  379. {t('By Response Code')}
  380. </SegmentedControl.Item>
  381. </SegmentedControl>
  382. <CompactSelect
  383. value={query.responseCodeClass}
  384. options={HTTP_RESPONSE_CODE_CLASS_OPTIONS}
  385. onChange={handleResponseCodeClassChange}
  386. triggerProps={{
  387. prefix: t('Response Code'),
  388. }}
  389. />
  390. </PanelControls>
  391. </ModuleLayout.Full>
  392. {query.panel === 'duration' && (
  393. <Fragment>
  394. <ModuleLayout.Full>
  395. <DurationChart
  396. series={[
  397. {
  398. ...durationData[`avg(span.self_time)`],
  399. markLine: AverageValueMarkLine(),
  400. },
  401. ]}
  402. scatterPlot={sampledSpanDataSeries}
  403. onHighlight={highlights => {
  404. const firstHighlight = highlights[0];
  405. if (!firstHighlight) {
  406. setHighlightedSpanId(undefined);
  407. return;
  408. }
  409. const sample = findSampleFromDataPoint<
  410. (typeof durationSamplesData)[0]
  411. >(
  412. firstHighlight.dataPoint,
  413. durationSamplesData,
  414. SpanIndexedField.SPAN_SELF_TIME
  415. );
  416. setHighlightedSpanId(sample?.span_id);
  417. }}
  418. isLoading={isDurationDataFetching}
  419. error={durationError}
  420. />
  421. </ModuleLayout.Full>
  422. </Fragment>
  423. )}
  424. {query.panel === 'status' && (
  425. <Fragment>
  426. <ModuleLayout.Full>
  427. <ResponseCodeCountChart
  428. series={Object.values(responseCodeData).filter(Boolean)}
  429. isLoading={isResponseCodeDataLoading}
  430. error={responseCodeError}
  431. />
  432. </ModuleLayout.Full>
  433. </Fragment>
  434. )}
  435. <Feature features="performance-sample-panel-search">
  436. <ModuleLayout.Full>
  437. <SearchBar
  438. searchSource={`${ModuleName.HTTP}-sample-panel`}
  439. query={query.spanSearchQuery}
  440. onSearch={handleSearch}
  441. placeholder={t('Search for span attributes')}
  442. organization={organization}
  443. metricAlert={false}
  444. supportedTags={supportedTags}
  445. dataset={DiscoverDatasets.SPANS_INDEXED}
  446. projectIds={selection.projects}
  447. />
  448. </ModuleLayout.Full>
  449. </Feature>
  450. {query.panel === 'duration' && (
  451. <Fragment>
  452. <ModuleLayout.Full>
  453. <SpanSamplesTable
  454. data={durationSamplesData}
  455. isLoading={isDurationDataFetching || isDurationSamplesDataFetching}
  456. highlightedSpanId={highlightedSpanId}
  457. onSampleMouseOver={sample => setHighlightedSpanId(sample.span_id)}
  458. onSampleMouseOut={() => setHighlightedSpanId(undefined)}
  459. error={durationSamplesDataError}
  460. // TODO: The samples endpoint doesn't provide its own meta, so we need to create it manually
  461. meta={{
  462. fields: {
  463. 'span.response_code': 'number',
  464. },
  465. units: {},
  466. }}
  467. />
  468. </ModuleLayout.Full>
  469. <ModuleLayout.Full>
  470. <Button
  471. onClick={() => {
  472. trackAnalytics(
  473. 'performance_views.sample_spans.try_different_samples_clicked',
  474. {organization, source: ModuleName.HTTP}
  475. );
  476. refetchDurationSpanSamples();
  477. }}
  478. >
  479. {t('Try Different Samples')}
  480. </Button>
  481. </ModuleLayout.Full>
  482. </Fragment>
  483. )}
  484. {query.panel === 'status' && (
  485. <Fragment>
  486. <ModuleLayout.Full>
  487. <SpanSamplesTable
  488. data={responseCodeSamplesData ?? []}
  489. isLoading={isResponseCodeSamplesDataFetching}
  490. error={responseCodeSamplesDataError}
  491. // TODO: The samples endpoint doesn't provide its own meta, so we need to create it manually
  492. meta={{
  493. fields: {
  494. 'span.response_code': 'number',
  495. },
  496. units: {},
  497. }}
  498. />
  499. </ModuleLayout.Full>
  500. <ModuleLayout.Full>
  501. <Button
  502. onClick={() => {
  503. trackAnalytics(
  504. 'performance_views.sample_spans.try_different_samples_clicked',
  505. {organization, source: ModuleName.HTTP}
  506. );
  507. refetchResponseCodeSpanSamples();
  508. }}
  509. >
  510. {t('Try Different Samples')}
  511. </Button>
  512. </ModuleLayout.Full>
  513. </Fragment>
  514. )}
  515. </ModuleLayout.Layout>
  516. </DetailPanel>
  517. </PageAlertProvider>
  518. );
  519. }
  520. const SAMPLE_HOVER_DEBOUNCE = 10;
  521. const SPAN_SAMPLE_LIMIT = 10;
  522. // This is functionally a random sort, which is what we want
  523. const SPAN_SAMPLES_SORT = {
  524. field: 'span_id',
  525. kind: 'desc' as const,
  526. };
  527. const SpanSummaryProjectAvatar = styled(ProjectAvatar)`
  528. padding-right: ${space(1)};
  529. `;
  530. const HTTP_RESPONSE_CODE_CLASS_OPTIONS = [
  531. {
  532. value: '',
  533. label: t('All'),
  534. },
  535. {
  536. value: '2',
  537. label: t('2XXs'),
  538. },
  539. {
  540. value: '3',
  541. label: t('3XXs'),
  542. },
  543. {
  544. value: '4',
  545. label: t('4XXs'),
  546. },
  547. {
  548. value: '5',
  549. label: t('5XXs'),
  550. },
  551. ];
  552. const HeaderContainer = styled('div')`
  553. display: grid;
  554. grid-template-rows: auto auto auto;
  555. @media (min-width: ${p => p.theme.breakpoints.small}) {
  556. grid-template-rows: auto;
  557. grid-template-columns: auto 1fr auto;
  558. }
  559. `;
  560. const TitleContainer = styled('div')`
  561. width: 100%;
  562. position: relative;
  563. height: 40px;
  564. `;
  565. const Title = styled('h4')`
  566. position: absolute;
  567. bottom: 0;
  568. margin-bottom: 0;
  569. `;
  570. const MetricsRibbon = styled('div')`
  571. display: flex;
  572. flex-wrap: wrap;
  573. gap: ${space(4)};
  574. `;
  575. const PanelControls = styled('div')`
  576. display: flex;
  577. justify-content: space-between;
  578. gap: ${space(2)};
  579. `;