Package org.mockserver.telemetry
Class GenAiSpanExporter
java.lang.Object
org.mockserver.telemetry.GenAiSpanExporter
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 Summary
Modifier and TypeMethodDescriptionstatic GenAiSpanExporterstatic GenAiSpanExporterstartIfEnabled(Configuration configuration) AsstartIfEnabled()but preferring the values carried on the suppliedConfigurationinstance, falling back to the staticConfigurationPropertiesstore for each value the instance leaves unset, so trace export settings applied overPUT /mockserver/configurationtake effect here.static GenAiSpanExporterstartWithProcessor(io.opentelemetry.sdk.trace.SpanProcessor processor) Build a tracer provider with the given span processor and install its tracer into bothGenAiSpansandRequestSpans.voidstop()
-
Method Details
-
startIfEnabled
-
startIfEnabled
AsstartIfEnabled()but preferring the values carried on the suppliedConfigurationinstance, falling back to the staticConfigurationPropertiesstore for each value the instance leaves unset, so trace export settings applied overPUT /mockserver/configurationtake effect here.- Parameters:
configuration- the live server configuration, ornullto 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 bothGenAiSpansandRequestSpans. Visible for testing (a test can pass a processor over an in-memory span exporter). -
stop
public void stop()
-