Skip to content
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

Abort test on reaching metric limit #3861

Closed
ameetpal opened this issue Jul 19, 2024 · 3 comments
Closed

Abort test on reaching metric limit #3861

ameetpal opened this issue Jul 19, 2024 · 3 comments
Labels

Comments

@ameetpal
Copy link
Contributor

Feature Description

As of now following warning pops up when there are large number of urls in test
oi.logger.Warnf( "The test has generated metrics with %d unique time series, "+ "which is higher than the suggested limit of %d "+ "and could cause high memory usage. "+ "Consider not using high-cardinality values like unique IDs as metric tags "+ "or, if you need them in the URL, use the name metric tag or URL grouping. "+ "See https://grafana.com/docs/k6/latest/using-k6/tags-and-groups/ for details.", oi.cardinality.Count(), timeSeriesFirstLimit, )

Other than warning there should be an option to abort test when we see this warning, As this is causing high memory usage.

Suggested Solution (optional)

An K6 environment variable to stop test when this limit is reached

Already existing or connected issues / PRs (optional)

No response

@codebien
Copy link
Contributor

This mostly leads to #3198, where you can send the metrics to external metric storages, and you can set a threshold on a specific query. When the query crosses the threshold then the test is stopped by aborted by threshold if abort-on-failure option is set.

We don't have it in our short-term roadmap, so if you need it immediately then you can do it autonomously reproducing the same concept by building an Output extension.

@ameetpal
Copy link
Contributor Author

@codebien
Will i able to abort test from output extension ? i am not able to find any reference for it

@codebien
Copy link
Contributor

@ameetpal Yes, you can. Your output has to implement WithTestRunStop interface, then k6 passes on startup will call this function to pass the function to call when you want to abort.

Let we know if something isn't clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants