k6 icon indicating copy to clipboard operation
k6 copied to clipboard

Introduce Global matching pattern for URL within thresholds

Open ArturSuchowierski opened this issue 2 years ago • 1 comments

Feature Description

Global matching pattern is widely used across different automation tools, i.e. Cypress

cy.intercept({ method: 'PUT', url: '**/users/*' })

It would also bring benefit in terms of flexibility, when introduced to current k6 threshold url matching mechanism

We're now able to work with following url threshold: thresholds: { ‘webvital_largest_content_paint{url:www.example-url.com/somepage/someinneresource/page.html’ : [‘p(90) < 2500’], },

But this one isn't supported yet:

thresholds: { ‘webvital_largest_content_paint{url:www.example-url.com/**’ : [‘p(90) < 2500’], },

So for the case when particular URL is changing, i.e maybe including some token ID, or any other dynamic query string it wouldn't be possible to gather k6 metrics for following threshold based on global matched url

Suggested Solution (optional)

No response

Already existing or connected issues / PRs (optional)

No response

ArturSuchowierski avatar Jul 06 '23 09:07 ArturSuchowierski

Hi @ArturSuchowierski, sorry for the slow reply :bow: .

I did start writing #3198 around this with the idea to answer you after it, but forgot about it :(.

What you are asking is not impossible and currently ... likely not even all that hard to implement. I would argue thought the it will likely not scale great.

As the other issues explains the current threshold syntax, format and functionality is kind of basic and is a thing that is k6 specific. There are bunch of different things going on and many different issues with it.

I personally don't think that we will fix one single issue first as arguably the whole syntax/format has problems. So arguably we either

  1. won't do anything to thresholds - what we have been doing for years.
  2. completely redo them to fit everything we want, which arguably will be implementing promql and the underlying storage, which ... I kind of don't want to do :grimacing:
  3. Or 3 I guess work #3198

I am leaving this open for more discussions and am adding "evaluation needed"

mstoykov avatar Aug 22 '23 08:08 mstoykov