8000 Check `ignore` value for legacy configuration by quinnmil · Pull Request #812 · scoutapp/scout_apm_python · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Check ignore value for legacy configuration #812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
27 changes: 27 additions & 0 deletions tests/unit/core/test_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={},
6DCB 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
Loading
0