1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- import {useMemo} from 'react';
- import {useTheme} from '@emotion/react';
- import {IconGroup} from 'sentry/icons';
- import {t, tct} from 'sentry/locale';
- import type {Organization} from 'sentry/types';
- import {getTraceTabTitle} from 'sentry/views/performance/newTraceDetails/traceTabs';
- import {Row} from 'sentry/views/performance/traceDetails/styles';
- import {
- makeTraceNodeBarColor,
- type SiblingAutogroupNode,
- type TraceTree,
- type TraceTreeNode,
- } from '../../traceTree';
- import {IssueList} from './issues/issues';
- import {TraceDrawerComponents} from './styles';
- export function SiblingAutogroupNodeDetails({
- node,
- organization,
- onParentClick,
- }: {
- node: SiblingAutogroupNode;
- onParentClick: (node: TraceTreeNode<TraceTree.NodeValue>) => void;
- organization: Organization;
- }) {
- const theme = useTheme();
- const issues = useMemo(() => {
- return [...node.errors, ...node.performance_issues];
- }, [node.errors, node.performance_issues]);
- const parentTransaction = node.parent_transaction;
- return (
- <TraceDrawerComponents.DetailContainer>
- <TraceDrawerComponents.IconTitleWrapper>
- <TraceDrawerComponents.IconBorder
- backgroundColor={makeTraceNodeBarColor(theme, node)}
- >
- <IconGroup />
- </TraceDrawerComponents.IconBorder>
- <div style={{fontWeight: 'bold'}}>{t('Autogroup')}</div>
- </TraceDrawerComponents.IconTitleWrapper>
- <IssueList issues={issues} node={node} organization={organization} />
- <TraceDrawerComponents.Table className="table key-value">
- <tbody>
- {parentTransaction ? (
- <Row title="Parent Transaction">
- <td className="value">
- <a href="#" onClick={() => onParentClick(parentTransaction)}>
- {getTraceTabTitle(parentTransaction)}
- </a>
- </td>
- </Row>
- ) : null}
- <Row title={t('Grouping Logic')}>
- {t('5 or more sibling spans with the same operation and description.')}
- </Row>
- <Row title={t('Group Count')}>{node.groupCount}</Row>
- <Row title={t('Grouping Key')}>
- {tct('Span operation: [operation] and description: [description]', {
- operation: node.value.op,
- description: node.value.description,
- })}
- </Row>
- </tbody>
- </TraceDrawerComponents.Table>
- </TraceDrawerComponents.DetailContainer>
- );
- }
|