The registry of ctxflow-semconv is the only place where ctxflow attribute keys, span names and enums are defined. The Python constants (import ctxflow_semconv as sc), the JSON Schema that the core validates against, and the tables below are all generated from it. An unknown ctxflow.* key is left out when it arrives (the request is still accepted); see OTLP endpoint.
Generated from the registry of ctxflow-semconv 0.2.2.
Flags: chunk ids = the attribute holds chunk ids; content hash = a plain sha256 of text or document bytes. What leaves your process is on What is sent.
The tables below are the ctxflow.* keys. A turn also needs keys of the conventions ctxflow reads. These are the ones you write yourself when no instrumentation does (content keys lists which of them carry text):
| Key |
Value |
Where it is explained |
openinference.span.kind |
AGENT (or CHAIN) on the turn, RETRIEVER on a retrieval, TOOL on a tool call |
Agent turns |
input.value, output.value |
The question and the plain-text answer, on the turn span |
Agent turns |
retrieval.documents.N.document.id |
The chunk id as the vector store holds it |
A manual retrieval span |
retrieval.documents.N.document.score |
The retrieval score |
A manual retrieval span |
retrieval.documents.N.document.content |
The chunk text |
A manual retrieval span |
retrieval.documents.N.document.metadata |
JSON string with the C1 keys of the chunk |
Source identity |
gen_ai.operation.name |
chat, text_completion or generate_content on a model call |
Agent turns |
gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens |
Model and token counts |
Agent turns |
tool.name |
The tool name; a failure is the span status ERROR |
Agent turns |
| Span name | Description |
|---|
agent.turn | One turn of the agent. |
agent.tool_call | Tool call seen on the agent side. |
retrieval | Retrieval span (OpenInference RETRIEVER). |
mcp.tool {name} | MCP server span of a tool call. |
ingress.request | Ingress proxy span; identity from the mapping file. |
ctxflow.n8n.execution | n8n connector span with the identity of an execution. |
node.execute | n8n node span. |
workflow.execute | n8n workflow span. |
ingest.run | One ingestion run over a corpus version. |
ingest.document | Ingestion of one document. |
ingest.parse | Parse of one document. |
ingest.chunk | Chunking of one document. |
ingest.embed | Embedding of the chunks of one document. |
ingest.upsert | Write of the chunks of one document to the index. |
ingest.delete | Removal of the chunks of a deleted document. |
index.change | Deprecated: not produced by the current SDKs and collector. |
source.version | Deprecated: not produced by the current SDKs and collector. |
| Attribute | Type | Description |
|---|
ctxflow.source_id | string | Stable id of the document in its source system. |
ctxflow.source_version | string | Version in which the current content of the document first appeared. Without an explicit version, a content-derived label: h:<12 hex> of a plain sha256. |
ctxflow.source_hash | string | sha256 (64 hex) of the original document bytes as they are (no normalization). |
ctxflow.chunker_version | string | Parser and splitter with their settings, e.g. docling-<ver>/llamaindex-<splitter>-<size>-<overlap>. |
ctxflow.embed_model | string | Name of the embedding model. |
ctxflow.ingest.skipped | bool | The document was left in the index unchanged. |
ctxflow.ingest.skip_reason | string | Why the document was skipped. |
ctxflow.reingest | bool | The run rebuilds an index that already had chunks. |
ctxflow.parse.chars | int | Length of the parsed text, in characters. |
ctxflow.chunks.count | int | Number of chunks a step produced or wrote. |
ctxflow.chunks.ids | string[] | Ids of the chunks a step produced or wrote, as the vector store holds them (the same ones the read side emits). |
ctxflow.chunks.text_hashes | string[] | Write-side chunk identity: sha256 (64 hex) of the normalized text of each chunk as stored (the same hash as ctxflow.retrieval.item_hashes: Unicode NFC, whitespace runs as one space, trim), same order as ctxflow.chunks.ids. An empty string where the chunk has no text. |
| Value | Description |
|---|
unchanged_hash | Skip reason when the source hash is already indexed. |
| Attribute | Type | Description |
|---|
ctxflow.id_mode | string | How the chunk ids of the index are produced. enum IdMode |
| Enum IdMode: Which index a chunk lives in, i.e. how its id is produced. |
|---|
default | Ids from the ingestion framework defaults (random). |
deterministic | uuid5 of source id, source version, chunker version and chunk index. |
unstructured | Ids from a third-party ingestion stack, not from us. |
| Value | Description |
|---|
ctxflow | Seed of the uuid5 namespace for deterministic chunk ids. |
| Attribute | Type | Description |
|---|
session.id | string | Conversation id. owner: openinference |
gen_ai.conversation.id | string | Conversation id, OTel GenAI name. owner: otel-genai |
user.id | string | End user of the agent, as sent by the app. owner: openinference |
ctxflow.turn | int | Index of the turn in the conversation. |
ctxflow.semconv.version | string | Resource attribute. The SEMCONV_VERSION of the contract the SDK was built with. |
tool.name | string | Name of the tool called. owner: openinference |
ctxflow.action.target | string | Destination of an action without content (collection name or recipient domain, never an address). |
ctxflow.action.params_hash | string | Hash of the action parameters as recorded on the span (gen_ai.tool.call.arguments or input.value), same rule as ctxflow.data.result_hash. |
ctxflow.action.status | string | Outcome of the action (server side). enum ActionStatus |
ctxflow.tool.status | string | Outcome of the tool call (client side). enum ActionStatus |
ctxflow.agent.id | string | Which agent or workflow, from the MCP gateway token. |
gen_ai.agent.id | string | Agent id, OTel GenAI name. owner: otel-genai |
ctxflow.agent.backend | string | Agent runtime that produced the turn (e.g. codex). |
ctxflow.agent.propagated | bool | Trace context and baggage were propagated to the MCP server. |
ctxflow.agent.tool_calls_seen | int | Tool calls seen in the agent events of the turn. |
ctxflow.agent.events_invalid | int | Agent events of the turn that could not be parsed. |
gen_ai.operation.name | string | OTel GenAI operation name. owner: otel-genai |
n8n.execution.id | string | n8n execution id; join key of the n8n connector. owner: n8n |
retrieval.documents.{i}.document.id | string | Id of the i-th retrieved document, as the vector store holds it. owner: openinference |
retrieval.documents.{i}.document.score | double | Retrieval score of the i-th retrieved document. owner: openinference |
retrieval.documents.{i}.document.metadata | string | JSON metadata of the i-th retrieved document (C1 attributes, no content). owner: openinference |
| Enum ActionStatus: Outcome of an action or tool call. |
|---|
OK | Succeeded. |
ERROR | Failed. |
| Value | Description |
|---|
x-ctxflow-id-mode | HTTP header from the agent to the MCP server with the index to query. |
invoke_agent | gen_ai.operation.name of an agent invocation. |
execute_tool | gen_ai.operation.name of a tool execution. |
The ctxflow.observe.* attributes and enums of this section are deprecated: no current SDK or collector produces them.
| Attribute | Type | Description |
|---|
ctxflow.retrieval.item_ids | string[] | Read-side item identity: the id of each item the vector store returned, in order, measured at the retrieval call before any reranker, compressor or snippet; the same id as ctxflow.chunks.ids, as the vector store holds it. An empty string where the item had no id. |
ctxflow.retrieval.item_hashes | string[] | sha256 (64 hex) of the normalized text of each returned item (Unicode NFC, whitespace runs as one space, trimmed), same order as the ids; the same hash the write side computes. An empty string where the item had no text. |
ctxflow.retrieval.item_verifiable | bool[] | Same order as the ids. False for an item with neither an id nor a text (for example a summary): it cannot be checked against the index and counts as neither up to date nor stale. |
ctxflow.retrieval.tool | bool | True on a ctxflow tool-call span (agent.tool_call, tool.<name>, mcp.tool <name>, or a span with ctxflow.action.* attributes) whose result lists retrieved items, for example an MCP search tool: the call then counts as a retrieval call. It does not deliver chunks (those come from retrieval.documents.* and reranker.output_documents.*), and OpenInference TOOL and GenAI execute_tool spans ignore it. |
ctxflow.observe.index | string | Deprecated: not produced by the current SDKs and collector. |
ctxflow.observe.chunk_id | string | Deprecated: not produced by the current SDKs and collector. |
ctxflow.observe.op | string | Deprecated: not produced by the current SDKs and collector. enum IndexOp |
ctxflow.observe.version | string | Deprecated: not produced by the current SDKs and collector. |
ctxflow.observe.text_hash | string | Deprecated: not produced by the current SDKs and collector. |
ctxflow.observe.level | string | Deprecated: not produced by the current SDKs and collector. enum ObserveLevel |
ctxflow.observe.observed_at | string | Deprecated: not produced by the current SDKs and collector. |
ctxflow.observe.poll_interval_s | double | Deprecated: not produced by the current SDKs and collector. |
ctxflow.observe.config_version | string | Deprecated: not produced by the current SDKs and collector. |
ctxflow.observe.resync | bool | Deprecated: not produced by the current SDKs and collector. |
ctxflow.observe.since | string | Deprecated: not produced by the current SDKs and collector. |
ctxflow.observe.event_id | string | Deprecated: not produced by the current SDKs and collector. |
| Enum IndexOp: Kind of change seen (index, source or rows). |
|---|
insert | First seen. |
update | Content changed. |
delete | Removed. |
| Enum ObserveLevel: Deprecated: not produced by the current SDKs and collector. |
|---|
N1 | Metadata only - ids, versions and C1 keys (index) or ETag/lastModified/size (source). |
N2 | Adds a hash computed inside the customer's system (text_hash of a chunk, sha256 of an original). |
ctxflow no longer judges whether the answer used a retrieved chunk (Context delivered). The ctxflow.usage span and its attributes are deprecated: no current SDK or collector produces them, and the core accepts them from older ones and ignores them. The omission kinds in the enum below are still produced, except context_ignored.
| Attribute | Type | Description |
|---|
ctxflow.usage.chunk_ids | string[] | Deprecated: not produced by the current SDKs and collector. |
ctxflow.usage.scores | double[] | Deprecated: not produced by the current SDKs and collector. |
ctxflow.usage.used_chunk_ids | string[] | Deprecated: not produced by the current SDKs and collector. |
ctxflow.usage.method | string | Deprecated: not produced by the current SDKs and collector. |
ctxflow.usage.threshold | double | Deprecated: not produced by the current SDKs and collector. |
ctxflow.usage.complete | bool | Deprecated: not produced by the current SDKs and collector. |
ctxflow.usage.expected_retrievals | int | Deprecated: not produced by the current SDKs and collector. |
ctxflow.usage.found_retrievals | int | Deprecated: not produced by the current SDKs and collector. |
| Span name | Description |
|---|
ctxflow.usage | Deprecated: not produced by the current SDKs and collector. |
| Enum OmissionKind: Observable context omissions computed from traces. |
|---|
no_retrieval | Turn without any retrieval span. |
context_ignored | Deprecated: not produced by the current SDKs and collector. |
tool_failed | Action span with status ERROR. |
stale_context | Retrieved chunk whose source changed before the turn (C6). |
unattributed | Retrieval or action span without session or user. |
| Enum Confidence: Confidence of a reconstructed link. |
|---|
verified | Ids match the C1 metadata of a chunk valid at t (DB log, traceparent). |
observed | Ids match only an earlier record of the chunk, not its C1 metadata. |
unresolved | Ids match nothing known. |
| Value | Description |
|---|
lexical-overlap-v1 | Deprecated: not produced by the current SDKs and collector. |
The ctxflow.observe.* attributes of this section are deprecated: no current SDK or collector produces them.
| Attribute | Type | Description |
|---|
ctxflow.observe.source | string | Deprecated: not produced by the current SDKs and collector. |
ctxflow.observe.etag | string | Deprecated: not produced by the current SDKs and collector. |
ctxflow.observe.last_modified | string | Deprecated: not produced by the current SDKs and collector. |
ctxflow.observe.size | int | Deprecated: not produced by the current SDKs and collector. |
| Enum SourceState: Is what the agent was shown still what the source had published at t? |
|---|
current | Published hash equals the chunk source hash. |
stale | The source changed or was deleted after the chunk was built. |
unknown | No publication seen at t, or the span has no source hash. Never inferred. |
ambiguous | The evidence does not decide at t (t inside the poll window of the deciding event, a resync gap, or two sources disagree). Never counted as current or stale. |
| Attribute | Type | Description |
|---|
ctxflow.data.kind | string | Kind of client system the tool result came from. enum DataKind |
ctxflow.data.source | string | Table or endpoint template, e.g. client.orders or GET /customers/{id}. |
ctxflow.data.record_ids | string[] | Primary keys or resource ids read. |
ctxflow.data.record_versions | string[] | Row version or ETag of each record, same order as the ids. |
ctxflow.data.record_tags | string | JSON object {id -> tags of its values, as the app sets them}. |
ctxflow.data.result_hash | string | sha256 (64 hex) of the result text (output.value on the span), normalized as the chunk text hashes (NFC, whitespace runs as one space, trim). Compute it with ctxflow_otel.content_hash. |
ctxflow.data.query_hash | string | Hash of the SQL text or the request line (db.query.text or db.statement on the span), same rule as ctxflow.data.result_hash. |
ctxflow.data.row_count | int | Rows or resources returned. |
ctxflow.data.truncated | bool | The row cap was hit. |
ctxflow.data.status | string | Outcome of the read. enum DataStatus |
ctxflow.usage.record_ids | string[] | Deprecated: not produced by the current SDKs and collector. |
ctxflow.usage.used_record_ids | string[] | Deprecated: not produced by the current SDKs and collector. |
ctxflow.usage.stale_records | string[] | Records that changed before the turn ended, as <read span id>:<record id>. |
ctxflow.usage.unknown_records | string[] | Records whose currency could not be determined. |
| Enum DataKind: Kind of client system a tool result came from. |
|---|
sql | SQL database. |
api | REST API. |
| Enum DataStatus: Outcome of a data read. |
|---|
OK | Succeeded with rows. |
EMPTY | Succeeded without rows, or 404. |
DENIED | Permission denied (SQL privilege, HTTP 401/403). |
ERROR | Any other failure. |
| Enum DataOmissionKind: C5 omissions of SQL and API tool results. |
|---|
empty_result | The read succeeded and returned nothing. |
truncated_result | Row cap hit, the agent saw part of the data. |
permission_denied | The role cannot read what the agent asked for. |
stale_data | A record read changed before the turn ended. |
tool_failed | The read failed for another reason. |
context_ignored | Deprecated: not produced by the current SDKs and collector. |
| Value | Description |
|---|
value-match-v1 | Deprecated: not produced by the current SDKs and collector. |
traceparent | Key of the sqlcommenter tag in the database log. |