Class GenAiSpanExporter

java.lang.Object
org.mockserver.telemetry.GenAiSpanExporter

public class GenAiSpanExporter extends Object
Optional exporter that publishes explicit OpenTelemetry spans via OTLP. Off unless mockserver.otelTracesEnabled is set. Self-configures the OTel trace SDK (OTLP HTTP/protobuf, JDK sender) and installs the tracer into both GenAiSpans and RequestSpans. Fail-soft: a startup failure logs one line and leaves span emission disabled.
  • Method Details

    • startIfEnabled

      public static GenAiSpanExporter startIfEnabled()
    • startIfEnabled

      public static GenAiSpanExporter startIfEnabled(Configuration configuration)
      As startIfEnabled() but preferring the values carried on the supplied Configuration instance, falling back to the static ConfigurationProperties store for each value the instance leaves unset, so trace export settings applied over PUT /mockserver/configuration take effect here.
      Parameters:
      configuration - the live server configuration, or null to read the static store
    • startWithProcessor

      public static GenAiSpanExporter startWithProcessor(io.opentelemetry.sdk.trace.SpanProcessor processor)
      Build a tracer provider with the given span processor and install its tracer into both GenAiSpans and RequestSpans. Visible for testing (a test can pass a processor over an in-memory span exporter).
    • stop

      public void stop()