Class OpenAITelemetry
java.lang.Object
dev.braintrust.instrumentation.openai.otel.OpenAITelemetry
Entrypoint for instrumenting OpenAI clients.
-
Method Summary
Modifier and TypeMethodDescriptionstatic OpenAITelemetryBuilderbuilder(io.opentelemetry.api.OpenTelemetry openTelemetry) Returns a newOpenAITelemetryBuilderconfigured with the givenOpenTelemetry.static OpenAITelemetrycreate(io.opentelemetry.api.OpenTelemetry openTelemetry) Returns a newOpenAITelemetryconfigured with the givenOpenTelemetry.com.openai.client.OpenAIClientwrap(com.openai.client.OpenAIClient client) Wraps the provided OpenAIClient, enabling telemetry for it.com.openai.client.OpenAIClientAsyncwrap(com.openai.client.OpenAIClientAsync client) Wraps the provided OpenAIClientAsync, enabling telemetry for it.
-
Method Details
-
create
Returns a newOpenAITelemetryconfigured with the givenOpenTelemetry. -
builder
Returns a newOpenAITelemetryBuilderconfigured with the givenOpenTelemetry. -
wrap
public com.openai.client.OpenAIClient wrap(com.openai.client.OpenAIClient client) Wraps the provided OpenAIClient, enabling telemetry for it. -
wrap
public com.openai.client.OpenAIClientAsync wrap(com.openai.client.OpenAIClientAsync client) Wraps the provided OpenAIClientAsync, enabling telemetry for it.
-