Class GlobalMeterProvider

java.lang.Object
io.opentelemetry.api.metrics.GlobalMeterProvider

public class GlobalMeterProvider extends Object
This class is a temporary solution until metrics SDK is marked stable.
  • Method Details

    • get

      public static MeterProvider get()
      Returns the globally registered MeterProvider.
    • set

      public static void set(MeterProvider provider)
      Sets the MeterProvider that should be the global instance. Future calls to get() will return the provided MeterProvider instance. This should be called once as early as possible in your application initialization logic, often in a static block in your main class.