Enum Class TelemetryProvider

java.lang.Object
java.lang.Enum<TelemetryProvider>
org.languagetool.tools.TelemetryProvider
All Implemented Interfaces:
Serializable, Comparable<TelemetryProvider>, Constable

public enum TelemetryProvider extends Enum<TelemetryProvider>
  • Enum Constant Details

  • Field Details

    • openTelemetry

      private final io.opentelemetry.api.OpenTelemetry openTelemetry
    • tracer

      private final io.opentelemetry.api.trace.Tracer tracer
  • Constructor Details

    • TelemetryProvider

      private TelemetryProvider()
  • Method Details

    • values

      public static TelemetryProvider[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TelemetryProvider valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • createSpan

      public <T> T createSpan(String spanName, io.opentelemetry.api.common.Attributes attributes, TracedFunction<T> tracedFunction) throws Exception
      Parameters:
      spanName - unique name of the span
      attributes - custom attributes
      tracedFunction - function called within the span
      Returns:
      the return value of wrappedValue function
      Throws:
      Exception
      Since:
      6.2 * @param spanName
    • createSpan

      public <T> T createSpan(String spanName, io.opentelemetry.api.common.Attributes attributes, WrappedValue<T> wrappedValue) throws Exception
      Parameters:
      spanName - unique name of the span
      attributes - custom attributes
      wrappedValue - function called within the span
      Returns:
      the return value of wrappedValue function
      Throws:
      Exception
      Since:
      6.2 * @param spanName
    • createSpan

      public void createSpan(String spanName, io.opentelemetry.api.common.Attributes attributes, WrappedVoid wrappedVoid) throws Exception
      Parameters:
      spanName - unique name of the span
      attributes - custom attributes
      wrappedVoid - function called within the span
      Throws:
      Exception
      Since:
      6.2
    • getOpenTelemetry

      public io.opentelemetry.api.OpenTelemetry getOpenTelemetry()
      To use the openTelemetry instance directly without the helper functions
      Returns:
      a opentelemetry instance
      Since:
      6.2
    • createSpan

      public io.opentelemetry.api.trace.Span createSpan(String spanName, io.opentelemetry.api.common.Attributes attributes)
      Parameters:
      spanName -
      attributes -
      Returns:
      a Span
      Since:
      6.2