Class OpenTelemetryAccessor

java.lang.Object
io.openliberty.microprofile.telemetry.spi.OpenTelemetryAccessor

public class OpenTelemetryAccessor extends Object
  • Constructor Details

    • OpenTelemetryAccessor

      public OpenTelemetryAccessor()
  • Method Details

    • getOpenTelemetryInfo

      public static OpenTelemetryInfo getOpenTelemetryInfo()
      Gets or creates the instance of OpenTelemetry associated with this application and returns it wrapped inside an OpenTelemetryInfo.

      If OpenTelemetry has a runtime instance this will be returned for all applications. If it does not, it will use the application metadata from the current thread to find the instance of OpenTelemetry associated with this application. If there is no metadata on the thread, or if the application has shut down, it will return an OpenTelemetryInfo containing a no-op OpenTelemetry object.

      Returns:
      An instance of OpenTelemetryInfo containing the instance of OpenTelemetry associated with this application.