Class InstrumentationSemConv

java.lang.Object
dev.braintrust.instrumentation.InstrumentationSemConv

public class InstrumentationSemConv extends Object
  • Field Details

  • Constructor Details

    • InstrumentationSemConv

      public InstrumentationSemConv()
  • Method Details

    • tagLLMSpanRequest

      public static void tagLLMSpanRequest(io.opentelemetry.api.trace.Span span, @Nonnull String providerName, @Nonnull String baseUrl, @Nonnull List<String> pathSegments, @Nonnull String method, @Nullable String requestBody)
    • tagLLMSpanRequest

      public static void tagLLMSpanRequest(io.opentelemetry.api.trace.Span span, @Nonnull String providerName, @Nonnull String baseUrl, @Nonnull List<String> pathSegments, @Nonnull String method, @Nullable String requestBody, @Nullable String modelId)
      Tag a span with LLM request metadata.
      Parameters:
      modelId - explicit model identifier — used by providers (e.g. Bedrock) where the model is not present in the request body. When null the model is extracted from the request body if possible.
    • tagLLMSpanResponse

      public static void tagLLMSpanResponse(io.opentelemetry.api.trace.Span span, @Nonnull String providerName, @Nonnull String responseBody)
    • tagLLMSpanResponse

      public static void tagLLMSpanResponse(io.opentelemetry.api.trace.Span span, @Nonnull String providerName, @Nonnull String responseBody, @Nullable Long timeToFirstTokenNanoseconds)
    • tagLLMSpanResponse

      public static void tagLLMSpanResponse(io.opentelemetry.api.trace.Span span, @Nonnull Throwable responseError)