Skip to content

Conversation

umaannamalai
Copy link
Contributor

This PR updates sync and async Bedrock instrumentation and tests to pull token counts directly from the response object. If a customer has an LLM token counting callback function registered, this will still take priority over the response token count values.

It also removes token count calculations from error cases as the agent will consistently stop reporting token counts when a error was met during the creation of a text generation.

TimPansino and others added 5 commits September 11, 2025 15:00
* Add deprecation warning for modules

* Megalinter fixes
Bumps the github_actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.30.1 to 3.30.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@f1f6e5f...192325c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.30.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github_actions
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
@umaannamalai umaannamalai changed the title Add response token count logic to Gemini instrumentation. Add response token count logic to Bedrock instrumentation. Sep 19, 2025
Copy link

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 6 0 0 0.76s
✅ MARKDOWN markdownlint 7 0 0 0 1.24s
✅ MARKDOWN markdown-link-check 7 0 0 20.57s
✅ PYTHON ruff 940 2 0 0 0.94s
✅ PYTHON ruff-format 940 2 0 0 0.35s
✅ YAML prettier 13 0 0 0 1.41s
✅ YAML v8r 13 0 0 6.86s
✅ YAML yamllint 13 0 0 0.61s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@mergify mergify bot added the tests-failing Tests failing in CI. label Sep 19, 2025
@codecov-commenter
Copy link

codecov-commenter commented Sep 19, 2025

Codecov Report

❌ Patch coverage is 86.66667% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.73%. Comparing base (b1408de) to head (777e0d1).

Files with missing lines Patch % Lines
newrelic/hooks/external_botocore.py 88.00% 7 Missing and 5 partials ⚠️
newrelic/config.py 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##           feature-llm-token-counts    #1504      +/-   ##
============================================================
- Coverage                     81.48%   80.73%   -0.76%     
============================================================
  Files                           209      210       +1     
  Lines                         23815    23955     +140     
  Branches                       3753     3770      +17     
============================================================
- Hits                          19406    19340      -66     
- Misses                         3153     3350     +197     
- Partials                       1256     1265       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hmstepanek hmstepanek marked this pull request as ready for review October 1, 2025 00:28
@hmstepanek hmstepanek requested a review from a team as a code owner October 1, 2025 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests-failing Tests failing in CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants