@josejuan314/openlit-opencode-plugin
v0.1.6
Published
OpenTelemetry telemetry plugin for [OpenCode](https://opencode.ai) integrating directly with [OpenLIT](https://openlit.io).
Readme
OpenLIT OpenCode Plugin
OpenTelemetry telemetry plugin for OpenCode integrating directly with OpenLIT.
Emits spans matching OpenLIT's coding_agent.* semantic convention:
coding_agent.session: Session lifecycle, duration, total tokens, costs.coding_agent.llm.turn: Turn-by-turn prompts, completions, tokens, finish reasons.coding_agent.tool.call: Tool executions, arguments, durations, and errors.
Installation
Add the plugin to your global OpenCode configuration (~/.config/opencode/opencode.jsonc):
opencode plugin @josejuan314/openlit-opencode-plugin --globalOr manually in opencode.json / opencode.jsonc:
{
"plugin": [
"@josejuan314/openlit-opencode-plugin"
]
}Configuration
Set the OpenLIT OTLP endpoint:
export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318"If OpenLIT is hosted behind a reverse proxy path (e.g., https://kopter.computer-mind.com/openlit), the plugin automatically normalizes the path to /v1/traces.
Content Capture Mode
By default, the plugin captures full prompt and completion content (full). To restrict to metadata only:
export OPENLIT_CONTENT_CAPTURE_MODE=metadata_only