OTEL Trace Ingestion

Publish OTEL Traces directly to your DBNL Deployment

OpenTellemetry (OTEL) Trace Ingestion allows for the richest data to be uploaded to your Project, but requires some off-platform coding and does not support backfilling data.

The following fields are required regardless of which ingestion method you are using:

  • input: The text input to the LLM as a string.

  • output: The text response from the LLM as a string.

  • timestamp: The UTC timecode associated with the LLM call as a timestamptz.

See the DBNL Semantic Convention for other semantically recognized fields. Using these naming conventions will allow DBNL to map semantic meaning to those columns and provide better Dashboards and Insights.

Example Trace Publishing Code

Embed the following code into your production AI product wherever you would normally capture traces. For more examples see the OpenTelemetry docs.

from opentelemetry import trace as trace_api
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk import trace as trace_sdk
from opentelemetry.sdk.trace.export import BatchSpanProcessor

tracer_provider = trace_sdk.TracerProvider()
trace_api.set_tracer_provider(tracer_provider)
tracer_provider.add_span_processor(
    BatchSpanProcessor(
        OTLPSpanExporter(
            endpoint="https://api.dev.dbnl.com/otel/v1/traces",
            headers={
                "Authorization": "Bearer API_TOKEN",
                "x-dbnl-project-id": "PROJECT_ID",
            },
        )
    )
)

Was this helpful?