Skip to main content

Export agent traces

Glean can push agent execution traces to your observability platform through standard OpenTelemetry Protocol (OTLP) export. This gives your team visibility into agent runs, tool calls, and LLM interactions using the monitoring tools you already operate.

Exported traces follow OpenTelemetry semantic conventions and include spans for agent runs, tool executions, and LLM calls. You can view them in any platform that accepts OTLP data, such as Datadog, Dynatrace, Grafana, Langfuse, LangSmith, Braintrust, or Splunk.

How it works

When you enable trace export, Glean pushes OTLP/HTTP traces with protobuf encoding to a customer-configured endpoint. Before export, Glean filters attributes, transforms span data, and excludes internal-only spans so that only customer-relevant telemetry leaves the system.

Each exported trace captures the full lifecycle of an agent run, from the initial request through tool calls and LLM interactions to the final response.

Set up trace export

1

Open the Admin console

Navigate to the trace export settings in the Admin console.

2

Enter the OTLP endpoint

Provide the OTLP/HTTP endpoint URL for your observability platform.

3

Configure request headers

Add any request headers your platform requires. For authentication tokens, use the {{token}} substitution syntax in the header value and enter the secret separately. The secret is stored encrypted and isn't shown again after you save.

4

Enable export

Turn on trace export. Glean begins pushing traces for new agent runs immediately.

Exported trace attributes

Each span includes a set of attributes that follow OpenTelemetry semantic conventions for generative AI. Every trace also includes a root span that acts as a structural anchor for the run. The attributes vary by span type.

Common attributes

These attributes appear on every exported span:

AttributeDescription
gen_ai.conversation.idConversation identifier
enduser.idEmail or identifier of the end user who initiated the run
gen_ai.operation.nameOperation name for the span, such as invoke_agent, execute_tool, or chat (omitted on the root span)

Agent run spans

AttributeDescription
gen_ai.agent.idUnique identifier for the agent
gen_ai.agent.nameDisplay name of the agent
glean.agent.modeAgent execution mode

Tool spans

The attributes on a tool span depend on the tool's export classification (see Tool data classification).

AttributeDescriptionWhen exported
gen_ai.tool.nameName of the toolAlways, but masked to GLEAN_INTERNAL_TOOL for redacted tools
gen_ai.tool.call.idUnique identifier for the tool callAlways
error.typeError classification, if the tool call failedAlways (when present)
gen_ai.tool.descriptionDescription of the toolOnly for fully exportable tools
gen_ai.tool.call.argumentsArguments passed to the toolOnly for fully exportable tools
gen_ai.tool.call.resultResult returned by the toolOnly for fully exportable tools

Tool data classification

Glean classifies each tool into one of two export levels:

  • Full export — the tool name, description, call arguments, and call result are all included in the trace. This applies to customer-authored tools: custom action packs, custom MCP servers, and custom OpenAPI servers, along with any template-backed tool configured to allow externalization.
  • Redacted — the tool name is replaced with the placeholder GLEAN_INTERNAL_TOOL, and only the call ID and error type (when present) are retained. The tool's description, arguments, and result are omitted because they may be sensitive, proprietary, or retrieval-heavy. Glean's native built-in tools are always redacted, including Glean Search, Code Search, Employee Search, Expert Search, People Search, and Glean Document Reader. Any tool whose classification can't be resolved also fails closed to redacted.

LLM call spans

AttributeDescription
gen_ai.request.modelModel requested for the LLM call
gen_ai.response.modelModel that produced the response
gen_ai.response.idProvider request identifier for the response
gen_ai.provider.nameLLM provider (for example, openai, anthropic, aws.bedrock)
gen_ai.response.finish_reasonsReasons the model stopped generating
gen_ai.usage.input_tokensNumber of input tokens
gen_ai.usage.output_tokensNumber of output tokens
gen_ai.usage.cache_read.input_tokensCache-read input tokens
gen_ai.usage.cache_creation.input_tokensCache-creation input tokens
gen_ai.usage.reasoning.output_tokensReasoning output tokens
gen_ai.response.time_to_first_chunkTime to first response chunk, in seconds
gen_ai.output.messagesModel output messages, serialized as JSON
error.typeError classification, if the LLM call failed

Scope and limitations

Trace export currently covers:

  • OTLP/HTTP with protobuf encoding
  • Admin-configured export to a single OTLP endpoint
  • Attribute filtering and internal span exclusion before export

The following are not currently supported:

  • OpenTelemetry logs or metrics
  • Historical bulk export or backfill
  • SIEM-specific export formats
  • Delivery durability guarantees

See also