@langfuse/opencode-observability-plugin
v0.1.0
Published
OpenCode plugin that sends session telemetry to Langfuse.
Downloads
103
Readme
Langfuse OpenCode Plugin
OpenCode plugin that sends OpenCode session telemetry to Langfuse. It traces user turns, assistant generations, tool calls, retries, reasoning output, compaction output, and failed generation steps.
Quick Start
Enable the plugin in your opencode.json or opencode.jsonc:
{
"experimental": {
"openTelemetry": true
},
"plugin": ["@langfuse/opencode-observability-plugin@latest"]
}Restart OpenCode after changing the config.
Langfuse Credentials
Create ~/.config/opencode/opencode-langfuse.json with your Langfuse credentials.
{
"publicKey": "pk-lf-...",
"secretKey": "sk-lf-...",
"baseUrl": "https://cloud.langfuse.com",
"environment": "development",
"userId": "your-user-id"
}Only publicKey and secretKey are required. If baseUrl is not set, the plugin uses https://cloud.langfuse.com. If environment is not set, it uses development.
You can also set credentials with environment variables:
export LANGFUSE_PUBLIC_KEY="pk-lf-..."
export LANGFUSE_SECRET_KEY="sk-lf-..."
export LANGFUSE_BASEURL="https://cloud.langfuse.com"
export LANGFUSE_ENVIRONMENT="development"
export LANGFUSE_USER_ID="your-user-id"If both LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY are set, the plugin uses environment variables instead of reading the config file. Optional values can be supplied either way.
