httpSamplesPanel.tsx 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  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} from 'sentry/views/starfish/queries/useDiscover';
  48. import {useSpanMetricsSeries} from 'sentry/views/starfish/queries/useDiscoverSeries';
  49. import {useIndexedSpans} from 'sentry/views/starfish/queries/useIndexedSpans';
  50. import {useSpanMetricsTopNSeries} from 'sentry/views/starfish/queries/useSpanMetricsTopNSeries';
  51. import {
  52. ModuleName,
  53. SpanFunction,
  54. SpanIndexedField,
  55. SpanMetricsField,
  56. type SpanMetricsQueryFilters,
  57. } from 'sentry/views/starfish/types';
  58. import {findSampleFromDataPoint} from 'sentry/views/starfish/utils/chart/findDataPoint';
  59. import {DataTitles, getThroughputTitle} from 'sentry/views/starfish/views/spans/types';
  60. import {useSampleScatterPlotSeries} from 'sentry/views/starfish/views/spanSummaryPage/sampleList/durationChart/useSampleScatterPlotSeries';
  61. export function HTTPSamplesPanel() {
  62. const router = useRouter();
  63. const location = useLocation();
  64. const query = useLocationQuery({
  65. fields: {
  66. project: decodeScalar,
  67. domain: decodeScalar,
  68. transaction: decodeScalar,
  69. transactionMethod: decodeScalar,
  70. panel: decodePanel,
  71. responseCodeClass: decodeResponseCodeClass,
  72. spanSearchQuery: decodeScalar,
  73. },
  74. });
  75. const organization = useOrganization();
  76. const {projects} = useProjects();
  77. const {selection} = usePageFilters();
  78. const supportedTags = useSpanFieldSupportedTags();
  79. const project = projects.find(p => query.project === p.id);
  80. const [highlightedSpanId, setHighlightedSpanId] = useDebouncedState<string | undefined>(
  81. undefined,
  82. [],
  83. SAMPLE_HOVER_DEBOUNCE
  84. );
  85. // `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
  86. const detailKey = query.transaction
  87. ? [query.domain, query.transactionMethod, query.transaction].filter(Boolean).join(':')
  88. : undefined;
  89. const handlePanelChange = newPanelName => {
  90. trackAnalytics('performance_views.sample_spans.filter_updated', {
  91. filter: 'panel',
  92. new_state: newPanelName,
  93. organization,
  94. source: ModuleName.HTTP,
  95. });
  96. router.replace({
  97. pathname: location.pathname,
  98. query: {
  99. ...location.query,
  100. panel: newPanelName,
  101. },
  102. });
  103. };
  104. const handleResponseCodeClassChange = newResponseCodeClass => {
  105. trackAnalytics('performance_views.sample_spans.filter_updated', {
  106. filter: 'status_code',
  107. new_state: newResponseCodeClass.value,
  108. organization,
  109. source: ModuleName.HTTP,
  110. });
  111. router.replace({
  112. pathname: location.pathname,
  113. query: {
  114. ...location.query,
  115. responseCodeClass: newResponseCodeClass.value,
  116. },
  117. });
  118. };
  119. const isPanelOpen = Boolean(detailKey);
  120. // The ribbon is above the data selectors, and not affected by them. So, it has its own filters.
  121. const ribbonFilters: SpanMetricsQueryFilters = {
  122. ...BASE_FILTERS,
  123. 'span.domain':
  124. query.domain === '' ? EMPTY_OPTION_VALUE : escapeFilterValue(query.domain),
  125. transaction: query.transaction,
  126. };
  127. // These filters are for the charts and samples tables
  128. const filters: SpanMetricsQueryFilters = {
  129. ...BASE_FILTERS,
  130. 'span.domain':
  131. query.domain === '' ? EMPTY_OPTION_VALUE : escapeFilterValue(query.domain),
  132. transaction: query.transaction,
  133. };
  134. const responseCodeInRange = query.responseCodeClass
  135. ? Object.keys(HTTP_RESPONSE_STATUS_CODES).filter(code =>
  136. code.startsWith(query.responseCodeClass)
  137. )
  138. : [];
  139. if (responseCodeInRange.length > 0) {
  140. // TODO: Allow automatic array parameter concatenation
  141. filters['span.status_code'] = `[${responseCodeInRange.join(',')}]`;
  142. }
  143. const search = MutableSearch.fromQueryObject(filters);
  144. const {
  145. data: domainTransactionMetrics,
  146. isFetching: areDomainTransactionMetricsFetching,
  147. } = useSpanMetrics(
  148. {
  149. search: MutableSearch.fromQueryObject(ribbonFilters),
  150. fields: [
  151. `${SpanFunction.SPM}()`,
  152. `avg(${SpanMetricsField.SPAN_SELF_TIME})`,
  153. `sum(${SpanMetricsField.SPAN_SELF_TIME})`,
  154. 'http_response_rate(3)',
  155. 'http_response_rate(4)',
  156. 'http_response_rate(5)',
  157. `${SpanFunction.TIME_SPENT_PERCENTAGE}()`,
  158. ],
  159. enabled: isPanelOpen,
  160. },
  161. Referrer.SAMPLES_PANEL_METRICS_RIBBON
  162. );
  163. const {
  164. isFetching: isDurationDataFetching,
  165. data: durationData,
  166. error: durationError,
  167. } = useSpanMetricsSeries(
  168. {
  169. search,
  170. yAxis: [`avg(span.self_time)`],
  171. enabled: isPanelOpen && query.panel === 'duration',
  172. },
  173. Referrer.SAMPLES_PANEL_DURATION_CHART
  174. );
  175. const {
  176. isFetching: isResponseCodeDataLoading,
  177. data: responseCodeData,
  178. error: responseCodeError,
  179. } = useSpanMetricsTopNSeries({
  180. search,
  181. fields: ['span.status_code', 'count()'],
  182. yAxis: ['count()'],
  183. topEvents: 5,
  184. enabled: isPanelOpen && query.panel === 'status',
  185. referrer: Referrer.SAMPLES_PANEL_RESPONSE_CODE_CHART,
  186. });
  187. // 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
  188. const sampleSpansSearch = MutableSearch.fromQueryObject({
  189. ...filters,
  190. 'span.domain': undefined,
  191. });
  192. // filter by key-value filters specified in the search bar query
  193. sampleSpansSearch.addStringMultiFilter(query.spanSearchQuery);
  194. if (query.domain === '') {
  195. sampleSpansSearch.addOp('(');
  196. sampleSpansSearch.addFilterValue('!has', 'span.domain');
  197. sampleSpansSearch.addOp('OR');
  198. // 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
  199. sampleSpansSearch.addOp('span.domain:[""]');
  200. sampleSpansSearch.addOp(')');
  201. } else {
  202. sampleSpansSearch.addFilterValue('span.domain', query.domain);
  203. }
  204. const durationAxisMax = computeAxisMax([durationData?.[`avg(span.self_time)`]]);
  205. const {
  206. data: durationSamplesData,
  207. isFetching: isDurationSamplesDataFetching,
  208. error: durationSamplesDataError,
  209. refetch: refetchDurationSpanSamples,
  210. } = useSpanSamples({
  211. search: sampleSpansSearch,
  212. fields: [
  213. SpanIndexedField.TRACE,
  214. SpanIndexedField.TRANSACTION_ID,
  215. SpanIndexedField.SPAN_DESCRIPTION,
  216. SpanIndexedField.RESPONSE_CODE,
  217. ],
  218. min: 0,
  219. max: durationAxisMax,
  220. enabled: isPanelOpen && query.panel === 'duration' && durationAxisMax > 0,
  221. referrer: Referrer.SAMPLES_PANEL_DURATION_SAMPLES,
  222. });
  223. const {
  224. data: responseCodeSamplesData,
  225. isFetching: isResponseCodeSamplesDataFetching,
  226. error: responseCodeSamplesDataError,
  227. refetch: refetchResponseCodeSpanSamples,
  228. } = useIndexedSpans({
  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. referrer: Referrer.SAMPLES_PANEL_RESPONSE_CODE_SAMPLES,
  243. });
  244. const sampledSpanDataSeries = useSampleScatterPlotSeries(
  245. durationSamplesData,
  246. domainTransactionMetrics?.[0]?.['avg(span.self_time)'],
  247. highlightedSpanId
  248. );
  249. const handleSearch = (newSpanSearchQuery: string) => {
  250. router.replace({
  251. pathname: location.pathname,
  252. query: {
  253. ...query,
  254. spanSearchQuery: newSpanSearchQuery,
  255. },
  256. });
  257. };
  258. const handleClose = () => {
  259. router.replace({
  260. pathname: router.location.pathname,
  261. query: {
  262. ...router.location.query,
  263. transaction: undefined,
  264. transactionMethod: undefined,
  265. },
  266. });
  267. };
  268. const handleOpen = useCallback(() => {
  269. if (query.transaction) {
  270. trackAnalytics('performance_views.sample_spans.opened', {
  271. organization,
  272. source: ModuleName.HTTP,
  273. });
  274. }
  275. }, [organization, query.transaction]);
  276. return (
  277. <PageAlertProvider>
  278. <DetailPanel detailKey={detailKey} onClose={handleClose} onOpen={handleOpen}>
  279. <ModuleLayout.Layout>
  280. <ModuleLayout.Full>
  281. <HeaderContainer>
  282. {project && (
  283. <SpanSummaryProjectAvatar
  284. project={project}
  285. direction="left"
  286. size={40}
  287. hasTooltip
  288. tooltip={project.slug}
  289. />
  290. )}
  291. <TitleContainer>
  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. </TitleContainer>
  311. </HeaderContainer>
  312. </ModuleLayout.Full>
  313. <ModuleLayout.Full>
  314. <MetricsRibbon>
  315. <MetricReadout
  316. align="left"
  317. title={getThroughputTitle('http')}
  318. value={domainTransactionMetrics?.[0]?.[`${SpanFunction.SPM}()`]}
  319. unit={RateUnit.PER_MINUTE}
  320. isLoading={areDomainTransactionMetricsFetching}
  321. />
  322. <MetricReadout
  323. align="left"
  324. title={DataTitles.avg}
  325. value={
  326. domainTransactionMetrics?.[0]?.[
  327. `avg(${SpanMetricsField.SPAN_SELF_TIME})`
  328. ]
  329. }
  330. unit={DurationUnit.MILLISECOND}
  331. isLoading={areDomainTransactionMetricsFetching}
  332. />
  333. <MetricReadout
  334. align="left"
  335. title={t('3XXs')}
  336. value={domainTransactionMetrics?.[0]?.[`http_response_rate(3)`]}
  337. unit="percentage"
  338. isLoading={areDomainTransactionMetricsFetching}
  339. />
  340. <MetricReadout
  341. align="left"
  342. title={t('4XXs')}
  343. value={domainTransactionMetrics?.[0]?.[`http_response_rate(4)`]}
  344. unit="percentage"
  345. isLoading={areDomainTransactionMetricsFetching}
  346. />
  347. <MetricReadout
  348. align="left"
  349. title={t('5XXs')}
  350. value={domainTransactionMetrics?.[0]?.[`http_response_rate(5)`]}
  351. unit="percentage"
  352. isLoading={areDomainTransactionMetricsFetching}
  353. />
  354. <MetricReadout
  355. align="left"
  356. title={DataTitles.timeSpent}
  357. value={domainTransactionMetrics?.[0]?.['sum(span.self_time)']}
  358. unit={DurationUnit.MILLISECOND}
  359. tooltip={getTimeSpentExplanation(
  360. domainTransactionMetrics?.[0]?.['time_spent_percentage()'],
  361. 'http.client'
  362. )}
  363. isLoading={areDomainTransactionMetricsFetching}
  364. />
  365. </MetricsRibbon>
  366. </ModuleLayout.Full>
  367. <ModuleLayout.Full>
  368. <PanelControls>
  369. <SegmentedControl
  370. value={query.panel}
  371. onChange={handlePanelChange}
  372. aria-label={t('Choose breakdown type')}
  373. >
  374. <SegmentedControl.Item key="duration">
  375. {t('By Duration')}
  376. </SegmentedControl.Item>
  377. <SegmentedControl.Item key="status">
  378. {t('By Response Code')}
  379. </SegmentedControl.Item>
  380. </SegmentedControl>
  381. <CompactSelect
  382. value={query.responseCodeClass}
  383. options={HTTP_RESPONSE_CODE_CLASS_OPTIONS}
  384. onChange={handleResponseCodeClassChange}
  385. triggerProps={{
  386. prefix: t('Response Code'),
  387. }}
  388. />
  389. </PanelControls>
  390. </ModuleLayout.Full>
  391. {query.panel === 'duration' && (
  392. <Fragment>
  393. <ModuleLayout.Full>
  394. <DurationChart
  395. series={[
  396. {
  397. ...durationData[`avg(span.self_time)`],
  398. markLine: AverageValueMarkLine(),
  399. },
  400. ]}
  401. scatterPlot={sampledSpanDataSeries}
  402. onHighlight={highlights => {
  403. const firstHighlight = highlights[0];
  404. if (!firstHighlight) {
  405. setHighlightedSpanId(undefined);
  406. return;
  407. }
  408. const sample = findSampleFromDataPoint<
  409. (typeof durationSamplesData)[0]
  410. >(
  411. firstHighlight.dataPoint,
  412. durationSamplesData,
  413. SpanIndexedField.SPAN_SELF_TIME
  414. );
  415. setHighlightedSpanId(sample?.span_id);
  416. }}
  417. isLoading={isDurationDataFetching}
  418. error={durationError}
  419. />
  420. </ModuleLayout.Full>
  421. </Fragment>
  422. )}
  423. {query.panel === 'status' && (
  424. <Fragment>
  425. <ModuleLayout.Full>
  426. <ResponseCodeCountChart
  427. series={Object.values(responseCodeData).filter(Boolean)}
  428. isLoading={isResponseCodeDataLoading}
  429. error={responseCodeError}
  430. />
  431. </ModuleLayout.Full>
  432. </Fragment>
  433. )}
  434. <Feature features="performance-sample-panel-search">
  435. <ModuleLayout.Full>
  436. <SearchBar
  437. searchSource={`${ModuleName.HTTP}-sample-panel`}
  438. query={query.spanSearchQuery}
  439. onSearch={handleSearch}
  440. placeholder={t('Search for span attributes')}
  441. organization={organization}
  442. metricAlert={false}
  443. supportedTags={supportedTags}
  444. dataset={DiscoverDatasets.SPANS_INDEXED}
  445. projectIds={selection.projects}
  446. />
  447. </ModuleLayout.Full>
  448. </Feature>
  449. {query.panel === 'duration' && (
  450. <Fragment>
  451. <ModuleLayout.Full>
  452. <SpanSamplesTable
  453. data={durationSamplesData}
  454. isLoading={isDurationDataFetching || isDurationSamplesDataFetching}
  455. highlightedSpanId={highlightedSpanId}
  456. onSampleMouseOver={sample => setHighlightedSpanId(sample.span_id)}
  457. onSampleMouseOut={() => setHighlightedSpanId(undefined)}
  458. error={durationSamplesDataError}
  459. // TODO: The samples endpoint doesn't provide its own meta, so we need to create it manually
  460. meta={{
  461. fields: {
  462. 'span.response_code': 'number',
  463. },
  464. units: {},
  465. }}
  466. />
  467. </ModuleLayout.Full>
  468. <ModuleLayout.Full>
  469. <Button
  470. onClick={() => {
  471. trackAnalytics(
  472. 'performance_views.sample_spans.try_different_samples_clicked',
  473. {organization, source: ModuleName.HTTP}
  474. );
  475. refetchDurationSpanSamples();
  476. }}
  477. >
  478. {t('Try Different Samples')}
  479. </Button>
  480. </ModuleLayout.Full>
  481. </Fragment>
  482. )}
  483. {query.panel === 'status' && (
  484. <Fragment>
  485. <ModuleLayout.Full>
  486. <SpanSamplesTable
  487. data={responseCodeSamplesData ?? []}
  488. isLoading={isResponseCodeSamplesDataFetching}
  489. error={responseCodeSamplesDataError}
  490. // TODO: The samples endpoint doesn't provide its own meta, so we need to create it manually
  491. meta={{
  492. fields: {
  493. 'span.response_code': 'number',
  494. },
  495. units: {},
  496. }}
  497. />
  498. </ModuleLayout.Full>
  499. <ModuleLayout.Full>
  500. <Button
  501. onClick={() => {
  502. trackAnalytics(
  503. 'performance_views.sample_spans.try_different_samples_clicked',
  504. {organization, source: ModuleName.HTTP}
  505. );
  506. refetchResponseCodeSpanSamples();
  507. }}
  508. >
  509. {t('Try Different Samples')}
  510. </Button>
  511. </ModuleLayout.Full>
  512. </Fragment>
  513. )}
  514. </ModuleLayout.Layout>
  515. </DetailPanel>
  516. </PageAlertProvider>
  517. );
  518. }
  519. const SAMPLE_HOVER_DEBOUNCE = 10;
  520. const SPAN_SAMPLE_LIMIT = 10;
  521. // This is functionally a random sort, which is what we want
  522. const SPAN_SAMPLES_SORT = {
  523. field: 'span_id',
  524. kind: 'desc' as const,
  525. };
  526. const SpanSummaryProjectAvatar = styled(ProjectAvatar)`
  527. padding-right: ${space(1)};
  528. `;
  529. const HTTP_RESPONSE_CODE_CLASS_OPTIONS = [
  530. {
  531. value: '',
  532. label: t('All'),
  533. },
  534. {
  535. value: '2',
  536. label: t('2XXs'),
  537. },
  538. {
  539. value: '3',
  540. label: t('3XXs'),
  541. },
  542. {
  543. value: '4',
  544. label: t('4XXs'),
  545. },
  546. {
  547. value: '5',
  548. label: t('5XXs'),
  549. },
  550. ];
  551. const HeaderContainer = styled('div')`
  552. display: grid;
  553. grid-template-rows: auto auto auto;
  554. @media (min-width: ${p => p.theme.breakpoints.small}) {
  555. grid-template-rows: auto;
  556. grid-template-columns: auto 1fr auto;
  557. }
  558. `;
  559. const TitleContainer = styled('div')`
  560. width: 100%;
  561. position: relative;
  562. height: 40px;
  563. `;
  564. const Title = styled('h4')`
  565. position: absolute;
  566. bottom: 0;
  567. margin-bottom: 0;
  568. `;
  569. const MetricsRibbon = styled('div')`
  570. display: flex;
  571. flex-wrap: wrap;
  572. gap: ${space(4)};
  573. `;
  574. const PanelControls = styled('div')`
  575. display: flex;
  576. justify-content: space-between;
  577. gap: ${space(2)};
  578. `;