Skip to content

docs(telemetry): document summary.tokens.llm.prompt_cached and completion_reasoning (#2305)#2318

Open
r266-tech wants to merge 2 commits into
volcengine:mainfrom
r266-tech:docs-telemetry-summary-cached-reasoning-tokens-2305
Open

docs(telemetry): document summary.tokens.llm.prompt_cached and completion_reasoning (#2305)#2318
r266-tech wants to merge 2 commits into
volcengine:mainfrom
r266-tech:docs-telemetry-summary-cached-reasoning-tokens-2305

Conversation

@r266-tech
Copy link
Copy Markdown
Contributor

What

#2305 started serializing two new LLM token counters in the operation-telemetry summary, but the telemetry guide still lists only input / output / total. This adds the two missing fields to the EN + ZH guides so developers can discover them.

Drift

In openviking/telemetry/operation.py, OperationTelemetry.build() now emits:

"llm": {
    "input": llm_input_tokens,
    "output": llm_output_tokens,
    "total": llm_total_tokens,
    "prompt_cached": llm_prompt_cached_tokens,            # tokens.llm.prompt_cached
    "completion_reasoning": llm_completion_reasoning_tokens,  # tokens.llm.completion_reasoning
},

These are sourced from provider usage details (add_token_usage_by_source(..., prompt_cached_tokens, completion_reasoning_tokens), recorded only when source == "llm"; see models/vlm/base.py docstring: "Number of cached prompt tokens / reasoning completion tokens from provider usage details"). But docs/{en,zh}/guides/07-operation-telemetry.md documented neither field, so anyone reading the telemetry summary to attribute LLM cost (cache savings / reasoning-token spend) couldn't find them.

Change (docs only, EN + ZH mirror)

  • Add summary.tokens.llm.prompt_cached and summary.tokens.llm.completion_reasoning rows to the summary.tokens field table in both guides.
  • Add the two keys to the JSON example's llm block.
  • Example values are non-zero (prompt_cached: 8, completion_reasoning: 4) on purpose — the guide states "numeric 0 values are omitted from the response", so a 0-valued example would contradict that contract.

No code or behavior change.

@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

2305 - Partially compliant

Compliant requirements:

Non-compliant requirements:

  • (No code changes in this PR; focuses solely on documentation)

Requires further human verification:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🏅 Score: 100
🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant