Skip to content

docs(ai): add cost calculation docs#16283

Merged
shellmayr merged 2 commits intomasterfrom
shellmayr/docs/add-cost-calculation-docs-for-ai-agents
Feb 6, 2026
Merged

docs(ai): add cost calculation docs#16283
shellmayr merged 2 commits intomasterfrom
shellmayr/docs/add-cost-calculation-docs-for-ai-agents

Conversation

@shellmayr
Copy link
Member

  • Add a new page in the agent monitoring documentation that outlines where we get the cost data from and how the cost is calculated
  • Add a new include that is used in manual instrumentation docs for Python, Node and Ruby that points out some gotchas with cost and token accounting
  • Point out which costs we don't account for, especially non-token-based costs

Closes TET-1868

@linear
Copy link

linear bot commented Feb 6, 2026

@vercel
Copy link

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Feb 6, 2026 0:27am
sentry-docs Ready Ready Preview, Comment Feb 6, 2026 0:27am

Request Review

@codeowner-assignment codeowner-assignment bot requested a review from a team February 6, 2026 12:17
@shellmayr shellmayr requested a review from a team February 6, 2026 12:17
@shellmayr shellmayr marked this pull request as ready for review February 6, 2026 12:17

If you're using manual instrumentation and your costs look unexpected (for example, negative costs), the most common cause is incorrectly set token attributes. See the "Token Usage and Cost Gotchas" section on the manual instrumentation page for your platform:

- [Python](/platforms/python/tracing/instrumentation/custom-instrumentation/ai-agents-module/#token-usage-and-cost-gotchas)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: A link in the AI agent cost documentation points to a non-existent page for JavaScript/Node.js, resulting in a 404 error for users.
Severity: MEDIUM

Suggested Fix

Update the markdown link in docs/product/insights/ai/agents/costs.mdx and docs/product/insights/ai/agents/getting-started.mdx from [JavaScript](/platforms/javascript/guides/node/ai-agent-monitoring/#token-usage-and-cost-gotchas) to [JavaScript](/platforms/javascript/common/ai-agent-monitoring/#token-usage-and-cost-gotchas).

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: docs/product/insights/ai/agents/costs.mdx#L69

Potential issue: The cost calculation documentation at
`docs/product/insights/ai/agents/costs.mdx` and the getting-started guide contain a
broken link to the JavaScript/Node.js AI agent monitoring documentation. The link
incorrectly points to `/platforms/javascript/guides/node/ai-agent-monitoring/`, which
does not exist. The correct location for this documentation is
`/platforms/javascript/common/ai-agent-monitoring/`. As a result, users trying to access
the token cost documentation for JavaScript/Node.js will encounter a 404 error,
preventing them from finding important information about token accounting.

Did we get this right? 👍 / 👎 to inform future reviews.

@shellmayr shellmayr merged commit 0f4bff4 into master Feb 6, 2026
14 checks passed
@shellmayr shellmayr deleted the shellmayr/docs/add-cost-calculation-docs-for-ai-agents branch February 6, 2026 12:51
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.

3 participants