metricsExplorer.tsx 876 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import {useState} from 'react';
  2. import {MetricDisplayType} from 'sentry/utils/metrics';
  3. import {MetricWidget, MetricWidgetProps} from 'sentry/views/ddm/widget';
  4. // TODO(ddm): move this to admin
  5. export default function MetricsExplorer() {
  6. const [widget, setWidget] = useState<MetricWidgetProps>({
  7. mri: '',
  8. op: undefined,
  9. query: '',
  10. groupBy: [],
  11. displayType: MetricDisplayType.LINE,
  12. position: 0,
  13. powerUserMode: true,
  14. showSummaryTable: true,
  15. onChange: () => {},
  16. sort: {name: 'name', order: 'asc'},
  17. });
  18. return (
  19. <MetricWidget
  20. widget={{
  21. ...widget,
  22. onChange: data => {
  23. setWidget(curr => ({...curr, ...data}));
  24. },
  25. }}
  26. datetime={{
  27. start: null,
  28. end: null,
  29. period: '7d',
  30. utc: false,
  31. }}
  32. projects={[]}
  33. environments={[]}
  34. />
  35. );
  36. }