All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sentry.spring.jakarta.tracing.SentryTransactionPointcutConfiguration Maven / Gradle / Ivy

There is a newer version: 8.0.0-rc.3
Show newest version
package io.sentry.spring.jakarta.tracing;

import com.jakewharton.nopen.annotation.Open;
import org.jetbrains.annotations.NotNull;
import org.springframework.aop.Pointcut;
import org.springframework.aop.support.ComposablePointcut;
import org.springframework.aop.support.annotation.AnnotationClassFilter;
import org.springframework.aop.support.annotation.AnnotationMatchingPointcut;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Role;

/** AOP pointcut configuration for {@link SentryTransaction}. */
@Configuration(proxyBeanMethods = false)
@Open
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public class SentryTransactionPointcutConfiguration {

  /**
   * Pointcut around which transactions are created.
   *
   * @return pointcut used by {@link SentryTransactionAdvice}.
   */
  @Bean
  @Role(BeanDefinition.ROLE_INFRASTRUCTURE)
  public @NotNull Pointcut sentryTransactionPointcut() {
    return new ComposablePointcut(new AnnotationClassFilter(SentryTransaction.class, true))
        .union(new AnnotationMatchingPointcut(null, SentryTransaction.class));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy