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 — chore: Deprecate `ai.monitoring.record_token_usage()` by alexander-alderman-webb · Pull Request #7918 · getsentry/sentry-python

Conversation

@alexander-alderman-webb

@alexander-alderman-webb alexander-alderman-webb commented Oct 7, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Collaborator

Description

Deprecate the function, pending removal in the upcoming major.
Inline uses of the function in integrations.

Issues

Contributes to #6894

Reminders

  • Please add tests to validate your changes, and lint your code using uv run ruff.
  • Add GH Issue ID & Linear ID (if applicable)
  • PR title should use conventional commit style (feat:, fix:, ref:, meta:)
  • For external contributors: CONTRIBUTING.md, Sentry SDK development docs, Discord community

Sorry, something went wrong.

Uh oh!

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

All reactions
@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/deprecate-record-token-usage branch from 01211f3 to 75d5882 Compare October 7, 2026 13:58
@alexander-alderman-webb
alexander-alderman-webb marked this pull request as ready for review October 7, 2026 14:01
@alexander-alderman-webb
alexander-alderman-webb requested a review from a team as a code owner October 7, 2026 14:01
@alexander-alderman-webb
chore: Deprecate ai.monitoring.record_token_usage()
6f26527
@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/deprecate-record-token-usage branch from 75d5882 to 6f26527 Compare October 7, 2026 14:04
sentrivana
sentrivana approved these changes Oct 7, 2026
View reviewed changes
Comment thread sentry_sdk/ai/monitoring.py Resolved

Uh oh!

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

@alexander-alderman-webb @sentrivana
Update sentry_sdk/ai/monitoring.py
44318e6
Co-authored-by: Ivana Kellyer <[email protected]>
cursor[bot]
cursor Bot reviewed Oct 7, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread sentry_sdk/integrations/cohere.py Resolved

Uh oh!

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

@alexander-alderman-webb
restore hasattr(res.meta, billed_units)
436b9e1
@github-actions

github-actions Bot commented Oct 7, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ 133451 passed | ⏭️ 7276 skipped | Total: 140727 | Pass Rate: 94.83% | Execution Time: 460m 47s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +34
Passed Tests 📈 +34
Failed Tests —
Skipped Tests —

All tests are passing successfully.

✅ Patch coverage is 85.71%. Project has 2593 uncovered lines.
❌ Project coverage is 90.26%. Comparing base (1f4ba26) to head (cb7a639).

Files with missing lines (6)
File Patch % Lines
sentry_sdk/integrations/cohere.py 66.67% ⚠️ 6 Missing and 4 partials
sentry_sdk/integrations/huggingface_hub.py 82.61% ⚠️ 4 Missing and 6 partials
sentry_sdk/integrations/litellm.py 92.31% ⚠️ 1 Missing and 4 partials
sentry_sdk/integrations/openai.py 96.15% ⚠️ 1 Missing and 3 partials
sentry_sdk/integrations/anthropic.py 100.00% ⚠️ 3 partials
sentry_sdk/ai/monitoring.py 0.00% ⚠️ 1 Missing
Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
- Coverage    90.37%    90.26%    -0.11%
==========================================
  Files          202       202         —
  Lines        26552     26625       +73
  Branches      9854      9926       +72
==========================================
+ Hits         23995     24032       +37
- Misses        2557      2593       +36
- Partials      1495      1515       +20

Generated by Codecov Action

All reactions

Sorry, something went wrong.

Uh oh!

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

ericapisani
ericapisani approved these changes Oct 7, 2026
View reviewed changes

@ericapisani ericapisani left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

These changes LGTM but warden looks to be right about huggingface_hub still using record_token_usage. Is the migration away from this there happening in a follow up?

Sorry, something went wrong.

Uh oh!

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

alexander-alderman-webb reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/deprecate-record-token-usage branch from 3a00c3d to a8818f9 Compare October 8, 2026 08:12
cursor[bot]
cursor Bot reviewed Oct 8, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread sentry_sdk/integrations/huggingface_hub.py Resolved

Uh oh!

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

@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/deprecate-record-token-usage branch from a8818f9 to 8238921 Compare October 8, 2026 08:18
cursor[bot]
cursor Bot reviewed Oct 8, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8238921. Configure here.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread sentry_sdk/integrations/huggingface_hub.py Resolved

Uh oh!

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

Comment thread sentry_sdk/integrations/anthropic.py Resolved

Uh oh!

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

@alexander-alderman-webb
add huggingface_hub
cb7a639
@alexander-alderman-webb
alexander-alderman-webb force-pushed the webb/deprecate-record-token-usage branch from 8238921 to cb7a639 Compare October 8, 2026 08:24
@alexander-alderman-webb
alexander-alderman-webb merged commit 7cb8094 into master Oct 8, 2026
462 of 466 checks passed

Uh oh!

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

@alexander-alderman-webb
alexander-alderman-webb deleted the webb/deprecate-record-token-usage branch October 8, 2026 08:55
@sentry-release-bot sentry-release-bot Bot mentioned this pull request Oct 12, 2026
publish: getsentry/[email protected] getsentry/publish#9830
Closed
6 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@ericapisani ericapisani ericapisani approved these changes
@sentrivana sentrivana sentrivana approved these changes

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

@alexander-alderman-webb @ericapisani @sentrivana
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 01402503 — 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.