eventDifferentialFlamegraph.tsx 1009 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import {useEffect} from 'react';
  2. import * as Sentry from '@sentry/react';
  3. import {Event} from 'sentry/types';
  4. interface EventDifferenialFlamegraphProps {
  5. event: Event;
  6. }
  7. export function EventDifferenialFlamegraph(props: EventDifferenialFlamegraphProps) {
  8. const evidenceData = props.event.occurrence?.evidenceData;
  9. const fingerprint = evidenceData?.fingerprint;
  10. const breakpoint = evidenceData?.breakpoint;
  11. const isValid = fingerprint !== undefined && breakpoint !== undefined;
  12. useEffect(() => {
  13. if (isValid) {
  14. return;
  15. }
  16. Sentry.withScope(scope => {
  17. scope.setContext('evidence data fields', {
  18. fingerprint,
  19. breakpoint,
  20. });
  21. Sentry.captureException(
  22. new Error('Missing required evidence data on function regression issue.')
  23. );
  24. });
  25. }, [isValid, fingerprint, breakpoint]);
  26. if (!isValid) {
  27. return null;
  28. }
  29. return (
  30. <div>
  31. <h3>EventDifferenialFlamegraph</h3>
  32. <p>TODO: Implement</p>
  33. </div>
  34. );
  35. }