Thresholds for each stage of a ramp-up

Greetings of the day. I was trying to set different thresholds for different stages of a ramp up ( largely for experimental purposes currently, I do understand that for most parts generally, one would define absolute thresholds for a system irrespective of the ramp up stage ), but the thresholds weren’t kicking in. Once I moved the thresholds outside the stages section, it worked as before.

Are different thresholds for different stages supported currently?

Hi @kembhootha,
welcome to the community forum :tada:

k6 doesn’t have a direct support for the requested feature but you could achieve the same goal by combining different features.

The approach would require setting at runtime a tag for each Stage then defining a Thresholds on Tags where the Tag is one of the Stages’ tags previously set.

Here is an example in the case a Tag stage is defined and one of the values is stage#1:

export const options = {
  thresholds: {
    'metric_name{stage:stage#1}': ['threshold_expression'],

Let me know if it works for you.

Thank you. I’m going to give this a try and will report back if I was successful.

1 Like