io.sentry.spring.jakarta.opentelemetry.SentryOpenTelemetryAgentWithoutAutoInitConfiguration Maven / Gradle / Ivy
package io.sentry.spring.jakarta.opentelemetry;
import com.jakewharton.nopen.annotation.Open;
import io.sentry.Sentry;
import io.sentry.SentryIntegrationPackageStorage;
import io.sentry.SentryOptions;
import io.sentry.opentelemetry.OpenTelemetryUtil;
import org.jetbrains.annotations.NotNull;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration(proxyBeanMethods = false)
@Open
public class SentryOpenTelemetryAgentWithoutAutoInitConfiguration {
@Bean
@ConditionalOnMissingBean(name = "sentryOpenTelemetryOptionsConfiguration")
public @NotNull Sentry.OptionsConfiguration
sentryOpenTelemetryOptionsConfiguration() {
return options -> {
SentryIntegrationPackageStorage.getInstance()
.addIntegration("SpringBoot3OpenTelemetryAgentWithoutAutoInit");
OpenTelemetryUtil.applyOpenTelemetryOptions(options, true);
};
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy