tencent cloud

Cloud Log Service

Agent Trace Field Definitions

Download
Focus Mode
Font Size
Last updated: 2026-09-04 15:28:00
AI-Translated & Reviewed
This document is a unified semantic specification for traces in Agent observability scenarios. It defines field meanings, data types, examples, and field requirements for third-party integration. Currently, OneSuite-Pilot reports Agent Trace data in accordance with this specification.
Note:
This semantic specification is extended based on the OpenTelemetry GenAI semantic specification. The OpenTelemetry GenAI semantic specification is still being revised and improved, and adjustments may occur during subsequent maintenance.

Data Model

Onesuite-Pilot converts AI Coding activities into OpenTelemetry traces and reports them through CLS Trace topics. Each log contains trace top-level fields, Resource fields, and Span attribute fields.
In the LogJson of CLS, attribute and resource are stored as JSON-encoded strings, and they are parsed into JSON objects respectively.
{
"traceID": "<32-bit hexadecimal Trace ID>",
"spanID": "<16-bit hexadecimal Span ID>",
"parentSpanID": "<Parent Span ID>",
"name": "chat <model>",
"kind": "client",
"start": "<Unix nanosecond timestamp>",
"end": "<Unix nanosecond timestamp>",
"duration": "<nanoseconds>",
"statusCode": "OK",
"resource": {
"service.name": "codebuddy",
"host.name": "<Host name>"
},
"attribute": {
"gen_ai.span.kind": "chat",
"gen_ai.operation.name": "chat",
"gen_ai.agent.type": "codebuddy",
"gen_ai.session.id": "<Session ID>",
"gen_ai.turn.id": "<Turn ID>",
"gen_ai.request.model": "<Request model>",
"gen_ai.usage.input_tokens": 1000,
"gen_ai.usage.output_tokens": 200
}
}

Span Types and Operation Types

gen_ai.span.kind
gen_ai.operation.name
Description
entry
enter_application
AI Coding Application Entry
agent
invoke_agent
Agent Invocation
step
react
ReAct Reasoning and Acting Round
chat
chat
Model Dialogue Invocation
tool
execute_tool
Tool Call

CLS Trace Top-Level Fields

Field Name
Type
Description
Example
Collection Condition
traceID
string
Unique identifier of a Trace, used to associate multiple spans in the same request chain.
17b5f957568ecb90b5b5b58d6bb56cbe
Required
spanID
string
Unique identifier of the current Span.
66dbc3146404b6b2
Required
parentSpanID
string
Parent Span ID of the current Span; usually empty for the root Span.
4523b3266604f28c
Required
name
string
Span name, used to display the current operation.
chat <model>
Required
kind
string
OpenTelemetry Span type.
client
Required
start
string
Span start time in nanoseconds.
1787150761999000000
Required
end
string
Span end time in nanoseconds.
1787150802462000000
Required
duration
string
Span duration in nanoseconds, typically calculated as end - start.
40463000000
Required
statusCode
string
Span execution status.
OK
Required
statusMessage
string
Supplementary description of the Span status.
tool execution failed
Collected when a status description is generated
attribute
JSON string
Span business attribute set, parsed as a JSON object.
{"gen_ai.span.kind":"chat"}
Required
resource
JSON string
Attribute set of the service and runtime environment to which the Span belongs, parsed as a JSON object.
{"service.name":"codebuddy"}
Required
traceState
string
Extended information of the W3C Trace Context.
``
No
links
JSON string
Links to other traces or spans associated with the current Span.
[]
Collected when an association exists
logs
JSON string
Log or event information associated with the Span.
[]
Collected when an event exists

Resource Fields

Field Name
Type
Description
Example
Collection Condition
service.name
string
Name of the application or Agent service that generates Trace data.
codebuddy
Required
host.name
string
Name of the host that generates data.
VM-138-200-tencentos
Required
deployment.environment.name
string
Name of the application runtime environment.
production
Collected when a runtime environment is configured

Public Identity and Context Fields

Field Name
Type
Description
Example
Collection Condition
gen_ai.span.kind
string
Business type of the current Span.
chat
Required
gen_ai.operation.name
string
Name of the specific operation in the current Span.
chat,execute_tool
Required
gen_ai.agent.type
string
Type of the AI Coding Agent that generates data.
codebuddy,workbuddy
Required
gen_ai.agent.id
string
Agent identifier associated with the current model or tool invocation. The specific generation rule is subject to the actual version.
<agent-id>
Collected conditionally in Chat and Tool spans
gen_ai.agent.name
string
Agent name.
main
Collected when the Agent Span provides a name.
gen_ai.session.id
string
Unique identifier of an AI Coding session, used to associate multiple spans within the same session.
<session-id>
Required
gen_ai.turn.id
string
Identifier of a user request or Agent processing turn within a session.
<session-id>:t73
Required
gen_ai.step.id
string
Identifier of a ReAct or Agent processing step.
<session-id>:t73:s4
Collected conditionally in Step, Chat, and Tool spans
gen_ai.user.id
string
Identifier of the user to whom the AI Coding data belongs.
122855467
Required
gen_ai.user.name
string
Display name of the user to whom the AI Coding data belongs.
user-name
Required
gen_ai.entry.type
string
AI application entry type.
cli
Collected when Entry Span exists

LLM Chat Fields

Field Name
Type
Description
Example
Collection Condition
gen_ai.provider.name
string
Name of the model service provider.
anthropic
Collect when obtainable
gen_ai.request.model
string
Name of the model specified in the request.
claude-opus-5
Collect when obtainable in Chat and Tool spans
gen_ai.response.model
string
Name of the model used in the actual returned result.
claude-opus-5
Collect when obtainable
gen_ai.response.finish_reasons
string[]
Reason for model generation completion.
["stop"]
Collect when obtainable in Chat spans
gen_ai.chat.duration_ms
integer
Duration of the Chat operation itself, in milliseconds.
16010
Collect when obtainable in Chat spans
gen_ai.input.messages
JSON array
List of input messages sent to the model or Agent.
[{"role":"user","parts":[...]}]
When message content collection is enabled or message data is generated
gen_ai.input.messages.hash
string
Hash value of the input message content, used for correlation or deduplication.
<32-bit hash>
Collect when a hash value is generated
gen_ai.input.messages_delta
JSON array
Incremental change information of input messages.
[{"type":"append",...}]
Collect when incremental information is generated
gen_ai.output.messages
JSON array
List of output messages returned by the model or Agent.
[{"role":"assistant","parts":[...]}]
Collect when output messages are generated

Token Usage Fields

Field Name
Type
Description
Example
Collection Condition
gen_ai.usage.input_tokens
integer
Number of tokens consumed by model input.
1000
Collect when obtainable
gen_ai.usage.output_tokens
integer
Number of tokens consumed by model output.
200
Collect when obtainable
gen_ai.usage.total_tokens
integer
Total number of tokens consumed by input and output.
1200
Collect when obtainable
gen_ai.usage.cache_read.input_tokens
integer
Number of input tokens read from the model provider's cache.
500
Collect when obtainable
gen_ai.usage.cache_creation.input_tokens
integer
Number of input tokens written to the model provider's cache.
100
Collect when obtainable
gen_ai.usage.cache_miss.input_tokens
integer
Number of input tokens that miss the cache.
50
Collect when obtainable
gen_ai.usage.reasoning_output_tokens
integer
Number of output tokens produced by the reasoning process.
0
Collect when obtainable

Agent Fields

Field Name
Type
Description
Example
Collection Condition
gen_ai.agent.message_count
integer
Number of messages contained in the Agent Span.
13
Collected when obtainable in Agent Span.
gen_ai.agent.tool_call_count
integer
Number of tool calls initiated within the Agent Span.
10
Collected when obtainable in Agent Span.
gen_ai.agent.name
string
Agent name.
main
Collected when the Agent Span provides a name.
gen_ai.agent.id
string
Agent identifier associated with the current model or tool invocation.
<agent-id>
Collected conditionally in Chat and Tool spans

Tool Fields

The following fields primarily appear in spans where gen_ai.span.kind=tool and gen_ai.operation.name=execute_tool.
Field Name
Type
Description
Example
Collection Condition
gen_ai.tool.call.id
string
Unique identifier of a tool call.
call_<id>
Collect during Tool Span
gen_ai.tool.name
string
Name of the called tool.
Bash,execute_command
Collect during Tool Span
gen_ai.tool.type
string
Tool type.
function
Collect during Tool Span
gen_ai.tool.call.arguments
JSON object / string
Input parameters of the tool call.
{"command":"<masked>"}
Collect when obtainable in Tool Span
gen_ai.tool.call.result
JSON object / string
Return result of the tool call.
{"status":"success"}
Collect when obtainable in Tool Span
gen_ai.tool.call.duration_ms
integer
Duration of the tool call, in milliseconds.
44
Collect during Tool Span
gen_ai.tool.error.type
string
Error type when the tool call fails.
tool_error
Collect when the tool call fails.
error.type
string
Error type of the current Span or operation.
tool_error
Collect when an error occurs.
Note:
gen_ai.tool.call.arguments and gen_ai.tool.call.result may appear as a JSON object or a JSON string, so handle both forms when using them.

ReAct Step Fields

Field Name
Type
Description
Example
Collection Condition
gen_ai.react.round
integer
ReAct iteration round, typically increments from 1.
8
Collect when obtainable in the relevant Span
gen_ai.react.finish_reason
string
Reason for ReAct or model call termination.
tool_calls,stop
Collect when obtainable
gen_ai.step.id
string
Unique identifier of the current inference and action step.
<session-id>:t73:s4
Collected conditionally in Step, Chat, and Tool spans

CodeBuddy, WorkBuddy, and Code Context Fields

Field Name
Type
Description
Example
Collection Condition
agent.codebuddy.cwd
string
Current working directory of the CodeBuddy session.
/workspace/project
Collected in CodeBuddy scenarios
agent.workbuddy.cwd
string
Current working directory of the WorkBuddy session.
/workspace/project
Collected in WorkBuddy scenarios
git.domain
string
Domain name of the Git service where the current code repository resides.
git.example.com
Collect when obtainable
git.repo
string
Identifier of the current code repository.
team/project
Collect when obtainable
git.branch
string
Current code branch.
main
Collect when obtainable
observed_time_unix_nano
string
Time when the data is observed or processed, in nanoseconds.
1787197097104000000
Collect when the field is actually generated

Compatibility Description

This document defines the unified semantics for Agent-observable traces. Different agents, models, and Span types may only apply to a subset of these fields. For specific field requirements, refer to the collection conditions in the corresponding field tables. As the OpenTelemetry GenAI semantic conventions are still evolving, subsequent field definitions and semantics may be adjusted with specification versions and updated in the release notes.
For installation instructions, see Ingesting AI Coding Agent Data (Onesuite-Pilot).

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback