-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: do not output timeseries whose resource_type
does not match an allowlist
#78
base: main
Are you sure you want to change the base?
Conversation
a406a4a
to
956cf35
Compare
Paving the ground for testing more than one script
9487dd4
to
d7f78d8
Compare
d7f78d8
to
172d78a
Compare
172d78a
to
4965c0b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable but its not clear to me how/where this will be used?
@d0ugal I don't think that's decided yet. My personal preference is to enforce this default everywhere, meaning this change will propagate to every browser check in there automatically. As we're in private preview, we can get away with this, and furthermore this will fix many browser scripts that are seeing their metrics truncated as they produce too many timeseries. In the future, if people request this, we can allow end users to tweak this allowlist by adding a field for this in the check settings. If for some reason we don't want to do the breaking part, there's also a nonbreaking route:
|
1b1763c
to
3830589
Compare
First take at browser metric filtering. This PR adds an allowlist of values for the
resource_type
tag, which k6 browser uses to indicate what prompted a request.The code roughly works as follows: After removing timeseries by metric name as it was previously done, the list of timeseries is walked again. If a timeseries contains the
resource_type
label, and the value for that label is not present in the allowlist, the timeseries is yeeted. The allowlist is case-insensitive.The allowlist itself defaults to just
document
, which means HTTP requests initiated by loading a webpage. This allowlist can be configured using theSM_K6_BROWSER_RESOURCE_TYPES
environment variable, as a comma-separated list of validresource_type
s. The special value*
, if present, allows allresource_type
s and thus skips this second walk entirely.A couple of integration tests, with different levels of granularity are added, both to cover the removal functionality and the handling of the
SM_K6_BROWSER_RESOURCE_TYPES
variable.The mechanism by which a user can specify this allowlist in the SM UI/API and then have that value traverse its way here is out of the scope of this PR. Whether we want to merge this (breaking) change before or after merging this is also out of scope: If we chose to merge this first, then we can make the change non-breaking to users by setting
SM_K6_BROWSER_RESOURCE_TYPES=*
in the runner.