feat(inbound-filters) Add health check inbound filter#49176
Conversation
jjbayer
left a comment
There was a problem hiding this comment.
Looks good to me! See comments about tests, especially the one about validate_project_config.
| @pytest.mark.django_db | ||
| @pytest.mark.parametrize("is_business", [True, False], ids=["business_plan", "free_plan"]) | ||
| def test_health_check_filters(call_endpoint, add_org_key, relay, default_project, is_business): | ||
| """ | ||
| Test that only business plans contain healthcheck filters | ||
| """ | ||
| relay.save() | ||
|
|
||
| default_project.update_option("filters:health-check", "1") | ||
| with Feature({"organizations:health-check-filter": is_business}): | ||
| result, status_code = call_endpoint(full_config=True, version=2) | ||
|
|
||
| assert status_code < 400 | ||
|
|
||
| configs = safe.get_path(result, "configs") | ||
|
|
||
| (project_key,) = configs.keys() | ||
| filter_settings = safe.get_path(configs, project_key, "config", "filterSettings") | ||
| assert filter_settings is not None | ||
|
|
||
| has_health_check = "healthCheck" in filter_settings | ||
|
|
||
| assert has_health_check == is_business |
There was a problem hiding this comment.
- This test could be moved to test_config.py, i.e. test
get_project_configdirectly instead of testing the endpoint. - Please call
validate_project_configin one of the tests to make sure that relay can parse the new config.
Co-authored-by: Joris Bayer <joris.bayer@sentry.io>
Co-authored-by: Joris Bayer <joris.bayer@sentry.io>
priscilawebdev
left a comment
There was a problem hiding this comment.
the code looks good to me
| # the number of events filtered because their group was discarded | ||
| project_total_received_discarded = 610 | ||
| # the number of events filtered because they refer to a healthcheck endpoint | ||
| project_total_healthcheck = 611 |
There was a problem hiding this comment.
do we need this? Jan told me once that this is something really old and not very used
There was a problem hiding this comment.
just saw that it is being used. so never mind
|
|
||
| if filter_id in ("browser-extensions", "localhost", "web-crawlers"): | ||
| if filter_id in ( | ||
| FilterStatKeys.BROWSER_EXTENSION, |
|
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #49176 +/- ##
=========================================
- Coverage 81.30 79.60 -1.70
=========================================
Files 4897 4897
Lines 205567 205584 +17
Branches 11051 11051
=========================================
- Hits 167121 163654 -3467
- Misses 38201 41685 +3484
Partials 245 245
|
1a3095f to
b65707f
Compare
This PR adds support for inbound filters for health check transactions.
implements: #49081