diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b2319539..bd95fec4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,7 @@ jobs: CIBW_ARCHS_LINUX: "auto aarch64" run: python -m cibuildwheel - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: ./wheelhouse/*.whl @@ -72,7 +72,7 @@ jobs: CIBW_ARCHS_MACOS: "x86_64 arm64" run: python -m cibuildwheel - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: ./wheelhouse/*.whl @@ -98,7 +98,7 @@ jobs: SCOUT_DISABLE_EXTENSIONS: "1" run: python setup.py bdist_wheel - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: dist/*.whl @@ -116,7 +116,7 @@ jobs: - name: Build sdist run: python setup.py sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: dist/*.tar.gz diff --git a/setup.py b/setup.py index b649c6fd..fcc86bf5 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ setup( name="scout_apm", - version="3.3.0", + version="3.3.1", description="Scout Application Performance Monitoring Agent", long_description=long_description, long_description_content_type="text/markdown", diff --git a/tests/unit/core/test_sampler.py b/tests/unit/core/test_sampler.py index 9d4d0bd3..88475012 100644 --- a/tests/unit/core/test_sampler.py +++ b/tests/unit/core/test_sampler.py @@ -168,3 +168,30 @@ def test_prefix_matching_precedence(config): # VIP users API should always be sampled assert sampler.should_sample("Controller/api/users/vip/list", False) is True + + +def test_should_sample_with_legacy_ignore(config): + """Test that sampling works correctly when only legacy 'ignore' config is set.""" + config.set( + sample_rate=100, # Return config to defaults + sample_endpoints={}, + sample_jobs={}, + ignore_endpoints=[], # No explicit ignore_endpoints + ignore_jobs=[], + ignore=["metrics", "health"], # Only set legacy ignore patterns + endpoint_sample_rate=None, + job_sample_rate=None, + ) + sampler = Sampler(config) + + # Legacy ignored endpoints should not be sampled + assert sampler.should_sample("Controller/metrics/stats", False) is False + assert sampler.should_sample("Controller/health/check", False) is False + + # Legacy ignore should be combined with ignore_endpoints + assert "metrics" in sampler.ignore_endpoints + assert "health" in sampler.ignore_endpoints + + # Non-ignored endpoints and jobs should be sampled + assert sampler.should_sample("Controller/users/list", False) is True + assert sampler.should_sample("Job/process_data", False) is True