Class OpenTelemetryClientTracerSetup

java.lang.Object
io.evitadb.driver.observability.trace.OpenTelemetryClientTracerSetup

public class OpenTelemetryClientTracerSetup extends Object
This class is responsible for passing an instance of OpenTelemetry to the EvitaClient driver, which will use it for tracing purposes. The OpenTelemetry instance has to be set before any tracing is performed. It follows the pattern of auto instrumentation libraries, that requires the user to set the OpenTelemetry instance from the application code that will be using EvitaClient.
Author:
Tomáš Pozler, FG Forrest a.s. (c) 2024
  • Constructor Details

    • OpenTelemetryClientTracerSetup

      public OpenTelemetryClientTracerSetup()
  • Method Details

    • getOpenTelemetry

      @Nonnull public static io.opentelemetry.api.OpenTelemetry getOpenTelemetry()
      Retrieves the instance of OpenTelemetry. If the instance is not initialized, it will be initialized before returning.
      Returns:
      the OpenTelemetry instance
    • setOpenTelemetry

      public static void setOpenTelemetry(@Nonnull io.opentelemetry.api.OpenTelemetry openTelemetry)
      Sets the OpenTelemetry instance to be used for tracing. This method is crucial to call to enable tracing capabilities from the EvitaClient driver. It follows the singleton pattern, so it is not recommended to set the OpenTelemetry instance more than once.
      Parameters:
      openTelemetry - the OpenTelemetry instance used for tracing from EvitaClient