Files
zeekay 1b367e2b62 chore: rebase the tree onto upstream master
The tree was a debranded snapshot of upstream taken around 2026-02-20, and
upstream has moved about five months since. This replaces it with upstream
master, mechanically re-derived: bin/debrand does the rename, and the
pipeline and squashed migrations are restored from the shipped tree.

Not a merge. The previous import replaced the tree wholesale in a single
commit, so there is no shared content history to merge against. Reproducing
the rename on the new tree is what actually converges.

What survives: .hanzo/workflows, the Dockerfiles and bin/docker* entrypoints,
compose files, LLM.md, and insights/migrations. The squashed initial
migration is load-bearing — the live database records it by name, so
upstream's ~918 individual migrations cannot come back.

Nine products are dropped as unreferenced. Twenty-one more that we do not run
are kept anyway because the core app still imports them; unpicking those is a
refactor and does not belong in a rebase.

This base does not build yet, and the reasons are not in the rename:
upstream now wants Python 3.13.13 against our 3.12.12 and Django 5.2 against
our 4.2, and the dependency manifests still name upstream packages that we
republish under our own names. Those are decisions, not renames.
2026-08-01 15:44:40 -07:00

189 lines
8.4 KiB
TypeScript

import { useMDXComponents } from 'scenes/onboarding/shared/OnboardingDocsContentWrapper'
const propertyColumnStyle = { minWidth: '150px' }
export const SpanEvent = (): JSX.Element => {
const { Markdown, dedent, CodeBlock } = useMDXComponents()
return (
<>
<Markdown>
{dedent`
A span is a single action within your application, such as a function call or vector database search.
**Event name**: \`$ai_span\`
### Core properties
`}
</Markdown>
<div className="Markdown">
<table className="my-4">
<thead>
<tr>
<th style={propertyColumnStyle}>Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td style={propertyColumnStyle}>
<code>$ai_trace_id</code>
</td>
<td>
<p>
The trace ID (a UUID to group related AI events together)
<br />
Must contain only letters, numbers, and the following characters: <code>-</code>,{' '}
<code>_</code>, <code>~</code>, <code>.</code>, <code>@</code>, <code>(</code>,{' '}
<code>)</code>, <code>!</code>, <code>'</code>, <code>:</code>, <code>|</code>
<br />
Example: <code>d9222e05-8708-41b8-98ea-d4a21849e761</code>
</p>
</td>
</tr>
<tr>
<td style={propertyColumnStyle}>
<code>$ai_session_id</code>
</td>
<td>
<p>
<em>(Optional)</em> Groups related traces together. Use this to organize traces by
whatever grouping makes sense for your application (user sessions, workflows,
conversations, or other logical boundaries).
<br />
Example: <code>session-abc-123</code>, <code>conv-user-456</code>
</p>
</td>
</tr>
<tr>
<td style={propertyColumnStyle}>
<code>$ai_span_id</code>
</td>
<td>
<p>
<em>(Optional)</em> Unique identifier for this span
<br />
Example: <code>bdf42359-9364-4db7-8958-c001f28c9255</code>
</p>
</td>
</tr>
<tr>
<td style={propertyColumnStyle}>
<code>$ai_span_name</code>
</td>
<td>
<p>
<em>(Optional)</em> The name of the span
<br />
Example: <code>vector_search</code>, <code>data_retrieval</code>,{' '}
<code>tool_call</code>
</p>
</td>
</tr>
<tr>
<td style={propertyColumnStyle}>
<code>$ai_parent_id</code>
</td>
<td>
<p>
<em>(Optional)</em> Parent ID for tree view grouping (<code>trace_id</code> or
another <code>span_id</code>)
<br />
Example: <code>537b7988-0186-494f-a313-77a5a8f7db26</code>
</p>
</td>
</tr>
<tr>
<td style={propertyColumnStyle}>
<code>$ai_input_state</code>
</td>
<td>
<p>
The input state of the span
<br />
Example:
</p>
<CodeBlock
language="json"
code={dedent`
{
"query": "search for documents about mascots"
}
`}
/>
<p>or any JSON-serializable state</p>
</td>
</tr>
<tr>
<td style={propertyColumnStyle}>
<code>$ai_output_state</code>
</td>
<td>
<p>
The output state of the span
<br />
Example:
</p>
<CodeBlock
language="json"
code={dedent`
{
"results": ["doc1", "doc2"],
"count": 2
}
`}
/>
<p>or any JSON-serializable state</p>
</td>
</tr>
<tr>
<td style={propertyColumnStyle}>
<code>$ai_latency</code>
</td>
<td>
<p>
<em>(Optional)</em> The latency of the span in seconds
<br />
Example: <code>0.361</code>
</p>
</td>
</tr>
<tr>
<td style={propertyColumnStyle}>
<code>$ai_is_error</code>
</td>
<td>
<p>
<em>(Optional)</em> Boolean to indicate if the span encountered an error
</p>
</td>
</tr>
<tr>
<td style={propertyColumnStyle}>
<code>$ai_error</code>
</td>
<td>
<p>
<em>(Optional)</em> The error message or object if the span failed
<br />
Example:
</p>
<CodeBlock
language="json"
code={dedent`
{
"message": "Connection timeout",
"code": "TIMEOUT"
}
`}
/>
</td>
</tr>
</tbody>
</table>
</div>
</>
)
}