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 — feat(telemetry): Add userId and sessionId metadata to experimental_telemetry by Raviguntakala · Pull Request #5279 · anomalyco/opencode

Conversation

@Raviguntakala

@Raviguntakala Raviguntakala commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

Summary

Adds userId and sessionId to experimental_telemetry.metadata across all AI SDK calls, enabling session-level trace grouping in observability platforms.

Motivation

Currently, OpenCode emits OTEL traces for cost and token usage tracking, but lacks user/session context. This makes it difficult to:

  • Group traces by user sessions
  • Track conversation flows end-to-end
  • Correlate multiple LLM calls within a single session

Testing

  • Tested with Langfuse ✅ - traces correctly group by session and display user attribution
  • No impact on existing functionality when OTEL is disabled

Sorry, something went wrong.

Uh oh!

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

All reactions
@Raviguntakala
feat(telemetry): Add userId and sessionId metadata to experimental_te…
926adc1
…lemetry
@rekram1-node
rekram1-node merged commit 8326640 into anomalyco:dev Dec 9, 2025
@omercnet

omercnet commented Jan 13, 2026

Copy link
Copy Markdown

@Raviguntakala how did you test this with langfuse? I'm not seeing the session/user grouping
check out https://github.com/omercnet/opencode-plugin-langfuse let me know if I'm doing something wrong

All reactions

Sorry, something went wrong.

Uh oh!

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

@Raviguntakala

Raviguntakala commented Jan 13, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

@Raviguntakala how did you test this with langfuse? I'm not seeing the session/user grouping check out https://github.com/omercnet/opencode-plugin-langfuse let me know if I'm doing something wrong

Hey @omercnet your plugin looks fine. No issue from Langfuse plugin side.

The reason you’re not seeing user/session grouping is from OpenCode side. After my PR got merged, Dax did a rework on the LLM calls and in that rework the userId and sessionId propagation got removed (not being passed into experimental_telemetry.metadata for LLM calls).

So Langfuse is receiving spans, but without userId/sessionId metadata, it can’t show user level / session level grouping.

I’ll raise another PR with the latest code changes to restore passing userId and sessionId across all LLM calls.

All reactions

Sorry, something went wrong.

Uh oh!

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

This was referenced Jan 13, 2026
experimental_telemetry metadata removed during LLM refactor #8193
Closed
fix(telemetry): restore userId and sessionId metadata in experimental_telemetry #8195
Merged
@Raviguntakala

Raviguntakala commented Jan 13, 2026

Copy link
Copy Markdown
Contributor Author

@Raviguntakala how did you test this with langfuse? I'm not seeing the session/user grouping check out https://github.com/omercnet/opencode-plugin-langfuse let me know if I'm doing something wrong

Opened a follow up PR to fix this: #8195

All reactions

Sorry, something went wrong.

Uh oh!

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

@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
@Raviguntakala
feat(telemetry): Add userId and sessionId metadata to experimental_te…
fc7d5ed
…lemetry (anomalyco#5279)
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
@Raviguntakala
feat(telemetry): Add userId and sessionId metadata to experimental_te…
20504be
…lemetry (anomalyco#5279)
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
@Raviguntakala
feat(telemetry): Add userId and sessionId metadata to experimental_te…
7467172
…lemetry (anomalyco#5279)
MarsQiu007 referenced this pull request in MarsQiu007/openNovel Jul 31, 2026
@Raviguntakala
feat(telemetry): Add userId and sessionId metadata to experimental_te…
7e1f1a8
…lemetry (#5279)
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
@Raviguntakala
feat(telemetry): Add userId and sessionId metadata to experimental_te…
2cc772b
…lemetry (anomalyco#5279)
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

@Raviguntakala @omercnet @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 01402775 — 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.