GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing github.com — feat: integrate OpenTelemetry by tianhuil · Pull Request #5245 · anomalyco/opencode Conversation
|
|
I think opencode already emits telemetry spans if you set: experimental_opentelemetry to true in your opencode.json |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…lemetry - Moved Tracing initialization to occur before the root CLI span is created. - Wrapped CLI parsing in a span to include command-line arguments in telemetry.
There was an error while loading. Please reload this page.
|
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Would be nice to have something like this https://www.reddit.com/r/ClaudeCode/comments/1pjon1r/til_that_claude_code_has_opentelemetry_metrics/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi, doesn't work for me either. Minimally, additional packages from OpenTelemetry JavaScript SDK need to be added |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I love this feature, is it possible to add open telemetry support and contains productivity metrics (such as acceptance rate or lines of code) like claude code? https://code.claude.com/docs/en/monitoring-usage#lines-of-code-counter |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Working on a PR to fully enable OTEL for opencode in a container image. Hope to be able to share it soon |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
If it helps. I submitted a merge request to add otel support awhile back, but it got very little traction: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@Phantal : Yes, I saw your PR. On my side, I am trying to obtain full leverage of AI SDK Otel implementation by Vercel. I want to add much less code than your PR and just minimally change the current Otel setup. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
|
Let me document how OTel in OpenCode works without this PR. I tested the current OpenCode ([email protected], [email protected], without this PR), and the spans are emitted/exported subject to the following pre-requisites:
Here:
There are 3 types (i.e. 3 values of span.name) logged: ai.streamText, ai.toolCall, ai.streamText.doStream. The spans are not coming directly from OpenCode but from Vercel AI SDK opencode is using. They contain full text of prompts. Here is one of 3 lines where span is created: https://github.com/vercel/ai/blob/c36a873ce00892a4c587c2e9492220b392aefd09/packages/ai/src/generate-text/stream-text.ts#L1142 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
@rekram1-node This isn't quite true since there's never a span collector set up (e.g. see #6629 and https://github.com/DEVtheOPS/opencode-plugin-otel) A quick search of otel shows many PRs and issues |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Should we use custom opencode plugins?
or wait native implementation? Because plugins don't have such support as opencode has and we need some guaranties that attributes names won't change in the near future because many commands need to write alerts and parsers of this traces. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
+1 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
opencode has native opentelemetry, set these: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@rekram1-node I think you need to also still set the following too? ie the OTEL_EXPORTER_ vars enable the trace exporting and experimental.openTelemetry = true enables the ai-sdk span features? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Any update? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2. — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.