GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — add experimental.open_telemetry config option to enable OTEL spans by noamzbr · Pull Request #4978 · anomalyco/opencode

Conversation

@noamzbr

@noamzbr noamzbr commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

Related Issues

  • Feature Request: Add Langfuse Tracing #219
  • [Question] detailed per-interaction telemetry (token counts and input composition) for opencode-model communications #2666

What this does

  • AI SDK has an experimental_telemetry flag. When enabled, it will automatically emit OTEL spans. I've added an optional config that turns that on in all calls to AI SDK generation functions.
  • The user can then use any OTEL supporting framework for tracing. For example, in Langfuse it's pretty simple - the user can build a simple plugin to send the generated spans to Langfuse.

Happy to add / edit / expand if needed!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cwegener reacted with hooray emoji r-costa-tornis, cwegener, fiktor, and Yash1hi reacted with heart emoji
All reactions
  • 🎉 1 reaction
  • ❤️ 4 reactions
@noamzbr
Enable AI SDK OTEL spans
7a7aaf4
- AI SDK emits Open Telemetry Spans when experimental_telemetry is true
- Define an open_telemetry config field to control this flag (false by default)
@r-costa-tornis

r-costa-tornis commented Dec 3, 2025

Copy link
Copy Markdown

👀

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@r-costa-tornis

r-costa-tornis commented Dec 3, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Can you provide a little doc explaining how to enable langfuse for example?
In the config files I mean.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@noamzbr

noamzbr commented Dec 3, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Sure, you should add "open_telemetry": true in your opencode.jsonc, and then add a relevant plugin. For Langfuse, the following plugin worked for me

/**
 * Langfuse OpenTelemetry Plugin for OpenCode
 * 
 * Requires: bun add @langfuse/otel @opentelemetry/sdk-node
 * Env vars: LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_HOST
 */
import { NodeSDK } from "@opentelemetry/sdk-node"
import { LangfuseSpanProcessor } from "@langfuse/otel"

let initialized = false

export const LangfusePlugin = async () => ({
  async config(config) {
    if (!config.open_telemetry || initialized) return
    initialized = true

    const processor = new LangfuseSpanProcessor()
    new NodeSDK({ spanProcessors: [processor] }).start()

    // // Flush frequently - Required in headless mode to make sure flushes are made before process exit
    // setInterval(() => processor.forceFlush(), 500)
  },
})

r-costa-tornis and fiktor reacted with heart emoji
All reactions
  • ❤️ 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@noamzbr
Merge dev into opencode/issue219-20251202121734
c72e904
@rekram1-node
rekram1-node force-pushed the dev branch from 398b39a to 5013d64 Compare December 5, 2025 05:13
@r-costa-tornis

r-costa-tornis commented Dec 5, 2025

Copy link
Copy Markdown

@rekram1-node 👀

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node

rekram1-node commented Dec 5, 2025

Copy link
Copy Markdown
Member

I'm a bit behind on prs at the moment but lemme take a look

r-costa-tornis reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node

rekram1-node commented Dec 5, 2025

Copy link
Copy Markdown
Member

/oc rename open_telemetry to be under "experimental" object in the config, update all locations it's used

r-costa-tornis reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@opencode-agent

opencode-agent Bot commented Dec 5, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Perfect! All changes are in place. Let me create a summary of what was changed:

Summary

I've successfully renamed open_telemetry to be under the experimental object in the config. Here are the changes made:

Changes Made:

  1. Config Schema (packages/opencode/src/config/config.ts):

    • Removed open_telemetry from the root config object
    • Added openTelemetry to the experimental object (line 673-676)
  2. Agent (packages/opencode/src/agent/agent.ts):

    • Updated line 233: cfg.open_telemetry → cfg.experimental?.openTelemetry
  3. Session Compaction (packages/opencode/src/session/compaction.ts):

    • Updated line 196: cfg.open_telemetry → cfg.experimental?.openTelemetry
  4. Session Prompt (packages/opencode/src/session/prompt.ts):

    • Updated line 618: cfg.open_telemetry → cfg.experimental?.openTelemetry
    • Updated line 1470: cfg.open_telemetry → cfg.experimental?.openTelemetry
  5. Session Summary (packages/opencode/src/session/summary.ts):

    • Updated line 114: cfg.open_telemetry → cfg.experimental?.openTelemetry
    • Updated line 156: cfg.open_telemetry → cfg.experimental?.openTelemetry

New Config Format:

Users should now use the following format in their opencode.jsonc:

{
  "experimental": {
    "openTelemetry": true
  }
}

Instead of the previous format:

{
  "open_telemetry": true
}

New%20session%20-%202025-12-05T16%3A37%3A16.175Z
opencode session  |  github run

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node rekram1-node changed the title Enable AI SDK Open Telemetry spans add experimental.open_telemetry config option to enable the ai sdk spans Dec 5, 2025
@rekram1-node rekram1-node changed the title add experimental.open_telemetry config option to enable the ai sdk spans add experimental.open_telemetry config option to enable OTEL spans Dec 5, 2025
@opencode-agent @rekram1-node
Moved open_telemetry under experimental object
26a5556
Co-authored-by: rekram1-node <[email protected]>
@r-costa-tornis

r-costa-tornis commented Dec 5, 2025

Copy link
Copy Markdown

🎉 🎉 🎉 🎉
Ty so much @rekram1-node

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node
rekram1-node merged commit 864c098 into anomalyco:dev Dec 5, 2025
@noamzbr noamzbr mentioned this pull request Dec 5, 2025
Feature Request: Add Langfuse Tracing #219
Closed
shuv1337 added a commit to shuv1337/shuvcode that referenced this pull request Dec 5, 2025
@shuv1337 @code-yeongyu
@actions-user wsx99outlook Frank @rekram1-node @adamdotdevin @DanielFGray @shantur @dbpolito @opencode-agent @jerome-benoit @thdxr @casonadams opencode @ry2009 @justmejulian @anthonyshew @noamzbr @nwthomas @Brendonovich
sync: merge upstream v1.0.134 (#90)
de6e0ec
* fix: ensure checkUpgrade sets `init:` (anomalyco#5040)

* chore: format code

* ci: use blacksmith runners in review workflow too (anomalyco#5042)

* zen: make session provider sticky

* ci: only maintainer can trigger

* ci: cleaner

* ignore: update download stats 2025-12-04

* fix(tui): cursor color

* Preserve prompt input when creating new session (anomalyco#4993)

* fix: model not being passed correctly to tool

* tweak: bash tool messages regarding timeouts and truncation more clear for agent (anomalyco#5066)

* tui: fix /new slash command being persisted in prompt input

* add optional prompt Input to Github Action (anomalyco#4828)

Co-authored-by: Github Action <[email protected]>
Co-authored-by: Aiden Cline <[email protected]>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>

* bump: builtin plugin versions

* feat: Add SAP AI Core provider support (anomalyco#5023)

Signed-off-by: Jérôme Benoit <[email protected]>

* core: ensure model npm package falls back to dev models config when not explicitly defined

* docs: add CodeCompanion.nvim integration instructions (anomalyco#5079)

* tweak: bash tool description re commit stuff

* core: add test for custom model npm package inheritance

* feat(desktop): terminal pane (anomalyco#5081)

Co-authored-by: Github Action <[email protected]>
Co-authored-by: Dax Raad <[email protected]>

* Revert "feat(desktop): terminal pane (anomalyco#5081)"

This reverts commit d763c11.

* release: v1.0.133

* Update Nix flake.lock and hashes

* Reapply "feat(desktop): terminal pane (anomalyco#5081)"

This reverts commit f9dcd97.

* chore: format code

* Update Nix flake.lock and hashes

* zen: fix byok

* ignore: fix provider credentials query for BYOK

Provider credentials field was being selected from ProviderTable even when the table wasn't joined (when byokProvider was undefined). Now the join is conditional - when byokProvider exists, we join and get the credentials; when it doesn't, the join condition is always false so provider remains null.

* docs: llama.cpp docs: `limit` moved under model (anomalyco#5089)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>

* fix: add getModel to SAP AI Core provider for correct SDK initialization (anomalyco#5086)

Signed-off-by: Jérôme Benoit <[email protected]>

* fix pty builds

* fix

* increase default scroll speed

* ci: review

* fix: ensure that vcs is still set to git even if no commits in repo

* ignore: rm slop commnand (only for opencode repo this isnt shipping)

* chore: format code

* ignore: cmd tweak

* tui: wrap dialog option descriptions (anomalyco#5083)

* ci: keybinds

* fix: ensure projects that go from having no commits to having commits have sessions migrated (anomalyco#5105)

Co-authored-by: GitHub Action <[email protected]>

* ignore: tweak

* ignore: update download stats 2025-12-05

* Zen: add codex max

* do not use required pty for local dev

* fix: anomalyco#5064 ProviderInitError github-copilot-enterprise (anomalyco#5123)

* feat(theme): Vercel (anomalyco#5119)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <[email protected]>

* fix(desktop): new session not selecting tab

* fix(desktop): clone pty session on reconnect

* add experimental.open_telemetry config option to enable OTEL spans (anomalyco#4978)

Co-authored-by: noamzbr <[email protected]>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <[email protected]>

* ignore: regen sdk

* fix(desktop): prompting

* fix(desktop): terminal cursor position

* feat: add max steps for supervisor and sub-agents (anomalyco#4062)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <[email protected]>

* tweak: bash tool improve output metadata for agent consumption, fix small timeout issue (anomalyco#5131)

* OpenCode Desktop app (anomalyco#5044)

Co-authored-by: Adam <[email protected]>

* Update Nix flake.lock and hashes

* release: v1.0.134

* sync: record last synced tag v1.0.134

* chore: format code

---------

Signed-off-by: Jérôme Benoit <[email protected]>
Co-authored-by: YeonGyu-Kim <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: wsx99outlook <[email protected]>
Co-authored-by: Frank <[email protected]>
Co-authored-by: Aiden Cline <[email protected]>
Co-authored-by: Adam <[email protected]>
Co-authored-by: Daniel Gray <[email protected]>
Co-authored-by: Shantur Rathore <[email protected]>
Co-authored-by: Daniel Polito <[email protected]>
Co-authored-by: Aiden Cline <[email protected]>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: Jérôme Benoit <[email protected]>
Co-authored-by: Dax Raad <[email protected]>
Co-authored-by: Cason Adams <[email protected]>
Co-authored-by: opencode <[email protected]>
Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: ry2009 <[email protected]>
Co-authored-by: Julian Visser <[email protected]>
Co-authored-by: Anthony Shew <[email protected]>
Co-authored-by: rekram1-node <[email protected]>
Co-authored-by: Noam Bressler <[email protected]>
Co-authored-by: noamzbr <[email protected]>
Co-authored-by: Nathan Thomas <[email protected]>
Co-authored-by: Brendan Allan <[email protected]>
@jeantil jeantil mentioned this pull request Dec 10, 2025
[Question] detailed per-interaction telemetry (token counts and input composition) for opencode-model communications #2666
Closed
@fiktor fiktor mentioned this pull request Feb 10, 2026
feat: integrate OpenTelemetry #5245
Closed
@kitlangton kitlangton mentioned this pull request Apr 10, 2026
feat(opencode): bridge global OTel tracer for AI SDK telemetry #21799
Closed
4 tasks
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
@noamzbr @opencode-agent @rekram1-node
add experimental.open_telemetry config option to enable OTEL spans (a…
6c921cd
…nomalyco#4978)

Co-authored-by: noamzbr <[email protected]>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <[email protected]>
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
@noamzbr @opencode-agent @rekram1-node
add experimental.open_telemetry config option to enable OTEL spans (a…
00332bf
…nomalyco#4978)

Co-authored-by: noamzbr <[email protected]>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <[email protected]>
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
@noamzbr @opencode-agent @rekram1-node
add experimental.open_telemetry config option to enable OTEL spans (a…
2b85878
…nomalyco#4978)

Co-authored-by: noamzbr <[email protected]>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <[email protected]>
MarsQiu007 referenced this pull request in MarsQiu007/openNovel Jul 31, 2026
@noamzbr @opencode-agent @rekram1-node
add experimental.open_telemetry config option to enable OTEL spans (#…
46389d1
…4978)

Co-authored-by: noamzbr <[email protected]>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <[email protected]>
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
@noamzbr @opencode-agent @rekram1-node
add experimental.open_telemetry config option to enable OTEL spans (a…
3aa25b0
…nomalyco#4978)

Co-authored-by: noamzbr <[email protected]>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@noamzbr @r-costa-tornis @rekram1-node
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.