Skip to content

ref(tracing): Remove unused _get_usage_attributes - #8157

Merged
sentrivana merged 1 commit into
major/3.0from
ivana/remove-get-usage-attributes
Oct 29, 2026
Merged

sentrivana merged 1 commit into
major/3.0from
ivana/remove-get-usage-attributes

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

Removes the private _get_usage_attributes() helper from sentry_sdk/tracing_utils.py. Nothing on major/3.0 calls it anymore.

It pulled gen_ai.usage.* token counts out of return values for the AI Agents @trace templates added in #4676. #7457 ("Remove trace template, trace_ignore_status_codes") deleted the template code that called it, but left the helper behind.

Evidence

  • On major/3.0, git grep -w _get_usage_attributes matches only the definition. There are no callers in sentry_sdk or tests.
  • No open PR touches it.

_get_value() is still imported by the LangChain integration, so it stays.

On master the helper is still used, because the trace templates still exist there. This change only applies to major/3.0.

Issues

n/a

via Ivana Kellyer.

--

View Junior Session [Sentry]

Co-Authored-By: Ivana Kellyer <ivana.kellyer@sentry.io>
@sentry-junior
sentry-junior Bot requested a review from a team as a code owner October 29, 2026 11:57
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 57523 passed | ⏭️ 2979 skipped | Total: 60502 | Pass Rate: 95.08% | Execution Time: 163m 31s

All tests are passing successfully.

✅ Patch coverage is 100.00% (no changed executable lines found; target 80%).
Project statement coverage is 90.25% (down 0.08 percentage points from base (3668ba4) to head (8aeb2a2)).

Files with missing lines (1)
File Coverage % Lines
sentry_sdk/tracing_utils.py 90.22% ⚠️ 59 Missing and 32 partials
Coverage diff
@@            Coverage Diff             @@
##        master     #8157       +/-##
==========================================
- Coverage    90.33%    90.25%    -0.08%
==========================================
  Files          203       198        -5
  Tracked lines     26872     21290     -5582
  Branches     10044      7374     -2670
==========================================
- Hits         24272     19214     -5058
+ Misses        2600      2076      -524
+ Partials      1520      1238      -282

Generated by Coverage Action

@sentrivana
sentrivana merged commit b2f0199 into major/3.0 Oct 29, 2026
153 checks passed
@sentrivana
sentrivana deleted the ivana/remove-get-usage-attributes branch October 29, 2026 12:06
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.

1 participant