missingInstrumentation.tsx 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import {useTheme} from '@emotion/react';
  2. import {Button} from 'sentry/components/button';
  3. import {IconSpan} from 'sentry/icons';
  4. import {t} from 'sentry/locale';
  5. import {getDuration} from 'sentry/utils/formatters';
  6. import type {TraceTreeNodeDetailsProps} from 'sentry/views/performance/newTraceDetails/traceDrawer/tabs/traceTreeNodeDetails';
  7. import {getTraceTabTitle} from 'sentry/views/performance/newTraceDetails/traceTabs';
  8. import {Row} from 'sentry/views/performance/traceDetails/styles';
  9. import {makeTraceNodeBarColor, type MissingInstrumentationNode} from '../../traceTree';
  10. import {TraceDrawerComponents} from './styles';
  11. export function MissingInstrumentationNodeDetails({
  12. node,
  13. onParentClick,
  14. scrollToNode,
  15. }: TraceTreeNodeDetailsProps<MissingInstrumentationNode>) {
  16. const theme = useTheme();
  17. const parentTransaction = node.parent_transaction;
  18. return (
  19. <TraceDrawerComponents.DetailContainer>
  20. <TraceDrawerComponents.HeaderContainer>
  21. <TraceDrawerComponents.Title>
  22. <TraceDrawerComponents.IconTitleWrapper>
  23. <TraceDrawerComponents.IconBorder
  24. backgroundColor={makeTraceNodeBarColor(theme, node)}
  25. >
  26. <IconSpan size="md" />
  27. </TraceDrawerComponents.IconBorder>
  28. <div style={{fontWeight: 'bold'}}>{t('Missing Instrumentation')}</div>
  29. </TraceDrawerComponents.IconTitleWrapper>
  30. </TraceDrawerComponents.Title>
  31. <TraceDrawerComponents.Actions>
  32. <Button size="xs" onClick={_e => scrollToNode(node)}>
  33. {t('Show in view')}
  34. </Button>
  35. </TraceDrawerComponents.Actions>
  36. </TraceDrawerComponents.HeaderContainer>
  37. <TraceDrawerComponents.Table className="table key-value">
  38. <tbody>
  39. {parentTransaction ? (
  40. <Row title="Parent Transaction">
  41. <td className="value">
  42. <a href="#" onClick={() => onParentClick(parentTransaction)}>
  43. {getTraceTabTitle(parentTransaction)}
  44. </a>
  45. </td>
  46. </Row>
  47. ) : null}
  48. <Row title={t('Gap Duration')}>
  49. {getDuration(node.value.timestamp - node.value.start_timestamp, 2, true)}
  50. </Row>
  51. <Row title={t('Previous Span')}>
  52. {node.previous.value.op} - {node.previous.value.description}
  53. </Row>
  54. <Row title={t('Next Span')}>
  55. {node.next.value.op} - {node.next.value.description}
  56. </Row>
  57. </tbody>
  58. </TraceDrawerComponents.Table>
  59. </TraceDrawerComponents.DetailContainer>
  60. );
  61. }