spanOpsQuery.tsx 888 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import omit from 'lodash/omit';
  2. import GenericDiscoverQuery, {
  3. DiscoverQueryProps,
  4. GenericChildrenProps,
  5. } from 'sentry/utils/discover/genericDiscoverQuery';
  6. import withApi from 'sentry/utils/withApi';
  7. import {SpanOps} from './types';
  8. type SpanOpsProps = {};
  9. type RequestProps = DiscoverQueryProps & SpanOpsProps;
  10. type ChildrenProps = Omit<GenericChildrenProps<SpanOpsProps>, 'tableData'> & {
  11. spanOps: SpanOps | null;
  12. };
  13. type Props = RequestProps & {
  14. children: (props: ChildrenProps) => React.ReactNode;
  15. };
  16. function SpanOpsQuery(props: Props) {
  17. return (
  18. <GenericDiscoverQuery<SpanOps, SpanOpsProps>
  19. route="events-span-ops"
  20. limit={20}
  21. {...omit(props, 'children')}
  22. >
  23. {({tableData, ...rest}) => {
  24. return props.children({spanOps: tableData, ...rest});
  25. }}
  26. </GenericDiscoverQuery>
  27. );
  28. }
  29. export default withApi(SpanOpsQuery);