OpenCode plugin for AxonHub tracing - automatically injects session headers for request tracing
npm install opencode-axonhub-tracingAn OpenCode plugin that automatically injects AxonHub tracing headers into your LLM requests. This allows AxonHub to group all requests from the same OpenCode session together for trace aggregation.
``bash`
npm install -g opencode-axonhub-tracingor
bun add -g opencode-axonhub-tracing
Add the plugin to your opencode.json:
`json`
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-axonhub-tracing"]
}
That's it! The plugin will automatically add:
- AH-Trace-Id - Set to the current OpenCode session ID.
1. The plugin hooks into the chat.headers event.AH-Trace-Id
2. It injects the into the headers of every AI provider request.sessionID`, ensuring all requests in a single session are linked in AxonHub.
3. The trace ID is derived from the OpenCode
- OpenCode 1.1.40 or later
- An AxonHub setup
MIT