Skip to content

feat(tracing): opt out of span content capture - #130

Open
wyTrivail wants to merge 1 commit into
DEVtheOPS:mainfrom
wyTrivail:feat/opt-out-trace-content
Open

wyTrivail wants to merge 1 commit into
DEVtheOPS:mainfrom
wyTrivail:feat/opt-out-trace-content

Conversation

@wyTrivail

Copy link
Copy Markdown

Description

Trace spans currently always export user prompts, model completions, and tool arguments/results via OpenInference input.value / output.value / llm.*_messages / tool.parameters. The only way to avoid that was OPENCODE_DISABLE_TRACES, which drops the spans entirely.

This adds an opt-out for payload capture while keeping traces, metrics, and token/cost attributes:

  • Env: OPENCODE_DISABLE_TRACE_CONTENT=1 (any non-empty value)
  • Plugin option: "captureContentInTraces": false

Default remains current behavior (content on traces). OPENCODE_CAPTURE_PROMPT_IN_LOGS is unchanged and still log-only.

Type of change

  • New feature (non-breaking change that adds functionality)

Checklist

  • I have read the CONTRIBUTING.md document
  • bun test, bun run typecheck, and bun run lint pass
  • Tests and README updated
  • Conventional Commits

Additional context

When content capture is disabled, tool error span status uses a generic tool failed message instead of the error body.

Made with Cursor

Traces currently always export prompts, completions, and tool payloads.
Add OPENCODE_DISABLE_TRACE_CONTENT / captureContentInTraces=false so
collectors can keep session, llm, and tool spans without that content.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants