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

io.sentry.spring.jakarta.webflux.SentryReactorThreadLocalAccessor Maven / Gradle / Ivy

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

import io.micrometer.context.ThreadLocalAccessor;
import io.sentry.IScopes;
import io.sentry.NoOpScopes;
import io.sentry.Sentry;
import org.jetbrains.annotations.ApiStatus;

@ApiStatus.Experimental
public final class SentryReactorThreadLocalAccessor implements ThreadLocalAccessor {

  public static final String KEY = "sentry-scopes";

  @Override
  public Object key() {
    return KEY;
  }

  @Override
  public IScopes getValue() {
    return Sentry.getCurrentScopes();
  }

  @Override
  public void setValue(IScopes value) {
    Sentry.setCurrentScopes(value);
  }

  @Override
  @SuppressWarnings("deprecation")
  public void reset() {
    Sentry.setCurrentScopes(NoOpScopes.getInstance());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy