Repository navigation
Conversation
Allow setting Langfuse trace tags from the opencode-langfuse.json config file (tags array) or as a plugin option in the OpenCode config, which takes precedence. Tags are applied to every exported span via the langfuse.trace.tags attribute.
tfon23
force-pushed
the
feat/configurable-trace-tags
branch
from
October 26, 2026 17:45
378877f to
4ff1cfd
Compare
Author
|
@bezbac Hello can you help me by approving ? |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #57
Adds configurable trace tags, settable from two sources (per @bezbac in #57; no
LANGFUSE_TAGSenv var):tagsarray in~/.config/opencode/opencode-langfuse.jsonTags are applied to every exported span via the
langfuse.trace.tagsattribute (an array of strings), matching the official Langfuse JS SDK, so Langfuse maps them to trace tags.Usage
Config file (
~/.config/opencode/opencode-langfuse.json):{ "publicKey": "pk-lf-...", "secretKey": "sk-lf-...", "tags": ["app:opencode-sdx"] }Plugin option (OpenCode 2):
{ "plugins": [["@langfuse/opencode-observability-plugin", { "tags": ["app:opencode-sdx"] }]] }Plugin option (OpenCode 1):
{ "plugin": [["@langfuse/opencode-observability-plugin", { "tags": ["app:opencode-sdx"] }]] }When both are set, the plugin option wins (mirroring how environment variables override the config file for the other settings). A malformed
tagsvalue is ignored with a warning rather than disabling tracing.Tests
langfuse.trace.tagsattribute is emitted when no tags are configured.decodePluginTagshandling of absent/malformed/unknown-key input.All checks pass: format, build, lint, knip, and the integration suite.