Skip to content

Conversation

@hmstepanek
Copy link
Contributor

Overview

Add adaptive sampling target config options & instances:

  • Add support for *.adaptive.sampling_target configuration settings.
  • Add support for multiple instances of adaptive sampler.

hmstepanek and others added 6 commits October 22, 2025 15:40
* Reorder inheritance on span nodes

Core tracing will be adding a bunch of logic to the span_event method which is called
via super on inheriting classes before those inheriting classes add additional
attributes. In order for the core tracing logic to work correctly, this inheritance
call order has to be reversed; the inheriting classes must first add the attributes
and THEN call super.

* Remove *args, **kwargs

* [MegaLinter] Apply linters fixes

---------

Co-authored-by: hmstepanek <30059933+hmstepanek@users.noreply.github.com>
* Fix removal of process attr call

* Add adaptive_sampling_target setting & fix logic

* Add a new setting: `distributed_tracing.sampler.adaptive_sampling_target` that can be
used to configure the sampling target.
* Previously the logic for remote parent sampled was slightly incorrect. The sampling
value from the tracestate header was used to determine remote parent sampled, instead of
from the parent header-this has been fixed. Additionally, the sampling value was only
grabbed from the trace state and newrelic headers if there was a priority-this has been
fixed too.
* Log statements have been added to assist with sampling debug.

---------

Co-authored-by: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
* Fix error when shutdown_agent called from harvest thread (#1552)

* fix(aiomysql): avoid wrapping pooled connections multiple times (#1553)

* fix(aiomysql): avoid wrapping pooled connections multiple times

* Move and rewrite regression test

* Tweak implementation of fix

---------

Co-authored-by: Tim Pansino <timpansino@gmail.com>

* Fix structlog tests (#1556)

* Bump the github_actions group with 4 updates (#1555)

Bumps the github_actions group with 4 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact), [actions/download-artifact](https://github.com/actions/download-artifact), [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/upload-artifact` from 4.6.2 to 5.0.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@ea165f8...330a01c)

Updates `actions/download-artifact` from 5.0.0 to 6.0.0
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@634f93c...018cc2c)

Updates `astral-sh/setup-uv` from 7.1.1 to 7.1.2
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](astral-sh/setup-uv@2ddd2b9...8585678)

Updates `github/codeql-action` from 4.30.9 to 4.31.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@16140ae...4e94bd1)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github_actions
- dependency-name: actions/download-artifact
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github_actions
- dependency-name: astral-sh/setup-uv
  dependency-version: 7.1.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github_actions
- dependency-name: github/codeql-action
  dependency-version: 4.31.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github_actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>

* Add instrumentation for new kinesis method (#1557)

* Add free-threaded Python to CI (#1562)

* Bump github/codeql-action in the github_actions group (#1566)

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


Updates `github/codeql-action` from 4.31.0 to 4.31.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@4e94bd1...0499de3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Region aware/ Claude 3+ bedrock support (#1561)

* Modify extractor logic.

* Add support for Claude Sonnet 3+ and region aware models.

* Update claude content extraction logic.

* Add support for Claude Sonnet 3+ and region aware models.

* Update claude content extraction logic.

* Add testing for aiobotocore.

* Restore newline.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Fix notice_error logic for non-iterable exceptions. (#1564)

* Revert "Fix notice_error logic for non-iterable exceptions. (#1564)" (#1568)

This reverts commit b9d9d3b.

* Add additional trace points for AWS Kinesis (#1569)

* Enable environment variables for attribute filters (#1558)

* Enable env vars for attribute filters

* [MegaLinter] Apply linters fixes

* Trigger tests

* Change attribute filters to space delimited

* Fix test assertion

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Tim Pansino <timpansino@gmail.com>

* Update version of cibuildwheel to latest (#1570)

* Force uv to use non-emulated Python on windows arm64 (#1567)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Co-authored-by: canonrock16 <35710450+canonrock16@users.noreply.github.com>
Co-authored-by: Tim Pansino <timpansino@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
* Fix error when shutdown_agent called from harvest thread (#1552)

* fix(aiomysql): avoid wrapping pooled connections multiple times (#1553)

* fix(aiomysql): avoid wrapping pooled connections multiple times

* Move and rewrite regression test

* Tweak implementation of fix

---------

Co-authored-by: Tim Pansino <timpansino@gmail.com>

* Fix structlog tests (#1556)

* Bump the github_actions group with 4 updates (#1555)

Bumps the github_actions group with 4 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact), [actions/download-artifact](https://github.com/actions/download-artifact), [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/upload-artifact` from 4.6.2 to 5.0.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@ea165f8...330a01c)

Updates `actions/download-artifact` from 5.0.0 to 6.0.0
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@634f93c...018cc2c)

Updates `astral-sh/setup-uv` from 7.1.1 to 7.1.2
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](astral-sh/setup-uv@2ddd2b9...8585678)

Updates `github/codeql-action` from 4.30.9 to 4.31.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@16140ae...4e94bd1)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github_actions
- dependency-name: actions/download-artifact
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github_actions
- dependency-name: astral-sh/setup-uv
  dependency-version: 7.1.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github_actions
- dependency-name: github/codeql-action
  dependency-version: 4.31.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github_actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>

* Add instrumentation for new kinesis method (#1557)

* Add free-threaded Python to CI (#1562)

* Bump github/codeql-action in the github_actions group (#1566)

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


Updates `github/codeql-action` from 4.31.0 to 4.31.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@4e94bd1...0499de3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Region aware/ Claude 3+ bedrock support (#1561)

* Modify extractor logic.

* Add support for Claude Sonnet 3+ and region aware models.

* Update claude content extraction logic.

* Add support for Claude Sonnet 3+ and region aware models.

* Update claude content extraction logic.

* Add testing for aiobotocore.

* Restore newline.

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Fix notice_error logic for non-iterable exceptions. (#1564)

* Revert "Fix notice_error logic for non-iterable exceptions. (#1564)" (#1568)

This reverts commit b9d9d3b.

* Add additional trace points for AWS Kinesis (#1569)

* Enable environment variables for attribute filters (#1558)

* Enable env vars for attribute filters

* [MegaLinter] Apply linters fixes

* Trigger tests

* Change attribute filters to space delimited

* Fix test assertion

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Tim Pansino <timpansino@gmail.com>

* Update version of cibuildwheel to latest (#1570)

* Force uv to use non-emulated Python on windows arm64 (#1567)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Add support 4 partial granularity tracing

* Move config consolidation into global settings

* [MegaLinter] Apply linters fixes

* Move inifinte tracing override to server side config

* [MegaLinter] Apply linters fixes

* Fix failing event loop tests

* Fixup: linter

* [MegaLinter] Apply linters fixes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Timothy Pansino <11214426+TimPansino@users.noreply.github.com>
Co-authored-by: canonrock16 <35710450+canonrock16@users.noreply.github.com>
Co-authored-by: Tim Pansino <timpansino@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Uma Annamalai <uannamalai@newrelic.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Lalleh Rafeei <84813886+lrafeei@users.noreply.github.com>
Co-authored-by: hmstepanek <30059933+hmstepanek@users.noreply.github.com>
@hmstepanek hmstepanek requested a review from a team as a code owner November 12, 2025 00:54
@hmstepanek hmstepanek marked this pull request as draft November 12, 2025 00:54
@github-actions
Copy link

github-actions bot commented Nov 12, 2025

MegaLinter analysis: Error

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 7 0 0 0.96s
✅ MARKDOWN markdownlint 7 0 0 0 1.4s
❌ PYTHON ruff 950 0 1 0 1.08s
✅ PYTHON ruff-format 950 4 0 0 0.39s
✅ YAML prettier 15 0 0 0 1.56s
✅ YAML v8r 15 0 0 5.64s
✅ YAML yamllint 15 0 0 0.71s

Detailed Issues

❌ PYTHON / ruff - 1 error
::error title=Ruff (F821),file=newrelic/config.py,line=407,col=45,endLine=407,endColumn=54::newrelic/config.py:407:45: F821 Undefined name `option_p1`

See detailed reports in MegaLinter artifacts

MegaLinter is graciously provided by OX Security

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

codecov-commenter commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 30.00000% with 238 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.35%. Comparing base (59633ac) to head (067a4c0).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
newrelic/config.py 4.10% 70 Missing ⚠️
newrelic/api/transaction.py 6.55% 57 Missing ⚠️
newrelic/core/node_mixin.py 5.08% 56 Missing ⚠️
newrelic/core/samplers/sampler_proxy.py 50.00% 9 Missing and 1 partial ⚠️
newrelic/hooks/external_botocore.py 0.00% 8 Missing ⚠️
newrelic/core/data_collector.py 0.00% 7 Missing ⚠️
newrelic/core/transaction_node.py 0.00% 5 Missing ⚠️
newrelic/core/application.py 50.00% 4 Missing ⚠️
newrelic/core/agent.py 50.00% 3 Missing ⚠️
newrelic/core/config.py 95.71% 2 Missing and 1 partial ⚠️
... and 8 more

❗ There is a different number of reports uploaded between BASE (59633ac) and HEAD (067a4c0). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (59633ac) HEAD (067a4c0)
2 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1577       +/-   ##
===========================================
- Coverage   81.76%   32.35%   -49.41%     
===========================================
  Files         207      208        +1     
  Lines       23943    24180      +237     
  Branches     3796     3827       +31     
===========================================
- Hits        19576     7823    -11753     
- Misses       3101    15772    +12671     
+ Partials     1266      585      -681     

☔ 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 force-pushed the add-adaptive-sampler-instances branch from 1c11ccf to c5c315b Compare November 12, 2025 21:44
@hmstepanek hmstepanek force-pushed the add-adaptive-sampler-instances branch from c5c315b to 3a4df8b Compare November 15, 2025 02:17
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.

3 participants