How to use the @sentry/integrations.TransactionActivity.pushActivity function in @sentry/integrations

To help you get started, we’ve selected a few @sentry/integrations examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github getsentry / sentry / src / sentry / static / sentry / app / utils / profiler.jsx View on Github external
return WrappedComponent => {
    const displayName = getDisplayName(WrappedComponent);

    return class extends React.Component {
      static displayName = displayName;

      static propTypes = {
        api: PropTypes.object,
      };

      componentWillUnmount() {
        this.finishProfile();
      }

      activity = TransactionActivity.pushActivity(displayName, {
        data: {},
        op: 'react',
        description: `<${displayName}>`,
      });

      finishProfile = () => {
        if (!this.activity) {
          return;
        }

        TransactionActivity.popActivity(this.activity);
        this.activity = null;
      };

      render() {
        return ;