Skip to main content
Prompt and response logging lets you store LLM inputs, outputs, model metadata, and token usage alongside the rest of your telemetry. If your application emits OpenTelemetry GenAI semantic convention attributes, Bronto can ingest them and make them available in Log Search and the event details panel.

What Bronto shows today

In the current Bronto UI, GenAI telemetry appears as regular searchable attributes on each event. You can:
  • Filter on GenAI attributes in Log Search
  • Group results by selected GenAI fields in aggregate views
  • Open an event and inspect the full prompt, response, model, and usage fields in the event details panel
The prompt and response data appears in the existing search and event inspection workflow. For prompt and response logging, the most useful attributes are:
AttributeWhat it representsGood for
gen_ai.input.messagesInput messages or prompt payloadInspecting the exact user input sent to the model
gen_ai.output.messagesModel response payloadReviewing generated output
gen_ai.system_instructionsSystem prompt or instruction blockAuditing assistant behavior
gen_ai.provider.nameModel provider such as openaiFiltering and grouping by provider
gen_ai.operation.nameOperation type such as chatBreaking down traffic by operation
gen_ai.request.modelRequested model nameComparing usage by model
gen_ai.response.modelActual response modelValidating what model served the request
gen_ai.response.idProvider response IDTracing a specific completion
gen_ai.response.finish_reasons.0Finish reason such as stopSpotting truncation or unusual stops
gen_ai.usage.input_tokensInput token countCost and usage analysis
gen_ai.usage.output_tokensOutput token countCost and usage analysis
gen_ai.usage.total_tokensTotal token countCost and usage analysis
You should also continue sending standard OpenTelemetry fields such as span.name, span.kind, and trace IDs so GenAI activity can be correlated with the rest of your application telemetry.

Capture the attributes with OpenTelemetry

The exact setup depends on your SDK and AI framework, but the main idea is the same:
  1. Instrument the LLM call with OpenTelemetry
  2. Attach GenAI semantic convention attributes to the span or log record
  3. Export the telemetry to Bronto through OTLP
Example application instrumentation:
from opentelemetry import trace

tracer = trace.get_tracer("my-ai-app")

with tracer.start_as_current_span("ChatOpenAI.chat") as span:
    span.set_attribute("gen_ai.provider.name", "openai")
    span.set_attribute("gen_ai.operation.name", "chat")
    span.set_attribute("gen_ai.request.model", "gpt-4o-mini")
    span.set_attribute(
        "gen_ai.input.messages",
        '[{"role":"user","parts":[{"type":"text","content":"Why is tracing useful in AI applications?"}]}]',
    )
    span.set_attribute(
        "gen_ai.system_instructions",
        '[{"type":"text","content":"You are a helpful assistant. Answer in 2-3 sentences."}]',
    )

    # Call your LLM here
    response_text = "Tracing helps you understand model inputs, outputs, timing, and failures."

    span.set_attribute(
        "gen_ai.output.messages",
        f'[{{"role":"assistant","parts":[{{"type":"text","content":"{response_text}"}}]}}]',
    )
    span.set_attribute("gen_ai.response.model", "gpt-4o-mini-2024-07-18")
    span.set_attribute("gen_ai.response.finish_reasons.0", "stop")
    span.set_attribute("gen_ai.usage.input_tokens", 33)
    span.set_attribute("gen_ai.usage.output_tokens", 74)
    span.set_attribute("gen_ai.usage.total_tokens", 107)
Example span attributes:
{
  "gen_ai.input.messages": "[{\"role\":\"user\",\"parts\":[{\"type\":\"text\",\"content\":\"Why is tracing useful in AI applications?\"}]}]",
  "gen_ai.output.messages": "[{\"role\":\"assistant\",\"parts\":[{\"type\":\"text\",\"content\":\"Tracing helps you understand model inputs, outputs, timing, and failures.\"}]}]",
  "gen_ai.system_instructions": "[{\"type\":\"text\",\"content\":\"You are a helpful assistant. Answer in 2-3 sentences.\"}]",
  "gen_ai.provider.name": "openai",
  "gen_ai.operation.name": "chat",
  "gen_ai.request.model": "gpt-4o-mini",
  "gen_ai.response.model": "gpt-4o-mini-2024-07-18",
  "gen_ai.response.id": "chatcmpl-abc123",
  "gen_ai.response.finish_reasons.0": "stop",
  "gen_ai.usage.input_tokens": 33,
  "gen_ai.usage.output_tokens": 74,
  "gen_ai.usage.total_tokens": 107
}
If you are using an instrumentation layer such as OpenLIT, Traceloop, LangChain instrumentation, or an OpenTelemetry-enabled SDK wrapper, many of these attributes may be emitted automatically. If not, attach them manually before export.

Export to Bronto

Send the telemetry to Bronto using OTLP as described in Connect Open Telemetry to Bronto. At a minimum, make sure:
  • The application or collector exports spans or logs containing the GenAI attributes
  • The data reaches Bronto through your normal OTLP pipeline

Search prompt and response data in Bronto

Once the telemetry is ingested, open Log Search and query the GenAI fields directly. Example filters:
"$gen_ai.provider.name"='openai'
"$gen_ai.request.model"='gpt-4o-mini'
"$gen_ai.response.finish_reasons.0"='stop'
To find requests with prompt payloads present:
"$gen_ai.input.messages" IS NOT NULL
To find requests with model output payloads present:
"$gen_ai.output.messages" IS NOT NULL

Group by GenAI fields

In Top List or other aggregate search views, you can group by GenAI attributes the same way you group by any other field. Useful grouping keys include:
  • $gen_ai.provider.name
  • $gen_ai.request.model
  • $gen_ai.response.model
  • $gen_ai.operation.name
  • $gen_ai.response.finish_reasons.0
These groupings are useful for answering questions like:
  • Which model is serving most requests?
  • Are requests split across multiple providers?
  • Which finish reasons are most common?
You can also aggregate token usage fields such as:
  • $gen_ai.usage.input_tokens
  • $gen_ai.usage.output_tokens
  • $gen_ai.usage.total_tokens
For example, use Sum over $gen_ai.usage.total_tokens to estimate total model usage over time.