opencode
opencode copied to clipboard
feat: integrate OpenTelemetry
Hi @thdxr, @adamdotdevin, and @rekram1-node
I love opencode. Trying to run it with open telemetry and wanted to add back some code to the project. If you generaly like this commit, I can work on resolving the merge conflict (just imports, nothing big).
Summary
- Integrate OpenTelemetry for enhanced tracing and monitoring capabilities
- Add type annotations to execute and toModelOutput methods in SessionPrompt
Changes
- Added OpenTelemetry dependencies for comprehensive observability
- Fixed type annotations in SessionPrompt methods for better type safety
- Updated package lock file with new dependencies
I think opencode already emits telemetry spans if you set:
experimental_opentelemetry to true in your opencode.json
Thanks for the quick response @rekram1-node.
I set the following and it didn't work:
//.opencode/opencode.jsonc
{
"$schema": "https://opencode.ai/config.json",
"experimental": {
"openTelemetry": true
},
}
I had to modify the repo to get it to emit open telemetry.