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

io.sentry.spring.opentelemetry.SentryOpenTelemetryAgentWithoutAutoInitConfiguration Maven / Gradle / Ivy

The newest version!
package io.sentry.spring.opentelemetry;

import com.jakewharton.nopen.annotation.Open;
import io.sentry.Sentry;
import io.sentry.SentryIntegrationPackageStorage;
import io.sentry.SentryOpenTelemetryMode;
import io.sentry.SentryOptions;
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("SpringBootOpenTelemetryAgentWithoutAutoInit");
      options.setOpenTelemetryMode(SentryOpenTelemetryMode.AGENT);
    };
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy