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()
    • 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()