From 8c15e53860d7500bbc4ae052aaa3457087ac427d Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 8 Nov 2024 14:29:00 +0000 Subject: [PATCH 01/13] Remove the admonition as it's no longer valid --- .../k6/next/javascript-api/k6-browser/page/on.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/sources/k6/next/javascript-api/k6-browser/page/on.md b/docs/sources/k6/next/javascript-api/k6-browser/page/on.md index 4dc34115f4..b19d29b16f 100644 --- a/docs/sources/k6/next/javascript-api/k6-browser/page/on.md +++ b/docs/sources/k6/next/javascript-api/k6-browser/page/on.md @@ -12,16 +12,10 @@ Registers a handler to be called whenever the specified event occurs. | event | string | `''` | Event to attach the handler to. Currently, only the `'console'` event is supported. | | handler | function | `null` | A function to be called every time the specified event is emitted. | -{{< admonition type="caution" >}} - -When using the `page.on` method, the page has to be explicitly [closed](https://grafana.com/docs/k6//javascript-api/k6-browser/page/close/) for the iteration to be able to finish. - -{{< /admonition >}} - ### Events -| Event | Description | -| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Event | Description | +| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `console` | Emitted every time the console API methods are called from within the page JavaScript context. The arguments passed into the handler are defined by the [`ConsoleMessage`](https://grafana.com/docs/k6//javascript-api/k6-browser/consolemessage) class. | ### Example From 47a3a81cdef23c96a962cbe82eccee5d266ffb36 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 8 Nov 2024 15:00:20 +0000 Subject: [PATCH 02/13] Add metricMessage doc --- .../k6-browser/metricmessage.md | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md diff --git a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md new file mode 100644 index 0000000000..2160bf05a5 --- /dev/null +++ b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md @@ -0,0 +1,58 @@ +--- +title: 'MetricMessage' +slug: 'metricmessage' +description: 'Browser module: MetricMessage Class' +weight: 03 +--- + +# MetricMessage + +`MetricMessage` objects are dispatched by page via registering a handler with [page.on('metric')](https://grafana.com/docs/k6//javascript-api/k6-browser/page/on). For each metric that it measured and emitted for the page, k6 browser delivers it to the registered handlers. + +## tag + +The Metric Message exposes a single method, `tag`. It will match the given `matches` with the current metric's url and name tags. When a match is found it will use `name` to replace the existing url and name tag values. + +Doing this will help group metrics with disparate url and name tags, which are in fact referencing the same resource, so that a correlation can be found over time and preventing high cardinality issues in the backend database that is storing the metrics. + + + +| Parameter | Type | Description | +| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| tagMatch | object | It is required. | +| tagMatch.name | string | It is a required field and it must not be an empty string. It will replace the current metric's url and name tag values when a match is found. | +| tagMatch.matches | object[] | It is a required field. It is an array of objects containing the regular expression and optional method to match against the current metric's url and name tags. It will iterate over all the objects in `matches` until a match is found, or to the end of the array if no match is found. | +| tagMatch.matches.url | RegExp | It is a required field. It is used to match against the current metric url and name tags. | +| tagMatch.matches.method | string | It is optional. When it is not set, a match will occur on all method types. When it is set, it will match on the one method that is set. Valid values are `'GET'`, `'POST'`, `'PUT'`, `'DELETE'`, `'PATCH'`, `'OPTIONS'`, `'HEAD'`, `'TRACE'` and `'CONNECT'` | + + + +### Example Usage + +{{< code >}} + + + +```javascript +// First we need to register a handler with `page.on('metric')`. +page.on('metric', (metric) => { + // It will find a match between the current metric url and name tags against + // the supplied regular expression in `url`. + metric.tag({ + // This is the new name value that will replace the existing value in the + // url and name tags when a match is found. + name: 'test', + // You can provide multiple matches here. + matches: [ + { + url: /^https:\/\/test\.k6\.io\/\?q=[0-9a-z]+$/, + // When a method is defined it will also need to match on that too. If a + // method is not provided it will match on all method types. + method: 'GET', + }, + ], + }); +}); +``` + +{{< /code >}} From 1ff70e3c117d914534df362fcf6a0ee4b69a6871 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 8 Nov 2024 14:38:09 +0000 Subject: [PATCH 03/13] Update page.on with the metric event --- .../next/javascript-api/k6-browser/page/on.md | 70 +++++++++++++++++-- 1 file changed, 65 insertions(+), 5 deletions(-) diff --git a/docs/sources/k6/next/javascript-api/k6-browser/page/on.md b/docs/sources/k6/next/javascript-api/k6-browser/page/on.md index b19d29b16f..ed9da01bc5 100644 --- a/docs/sources/k6/next/javascript-api/k6-browser/page/on.md +++ b/docs/sources/k6/next/javascript-api/k6-browser/page/on.md @@ -7,18 +7,19 @@ description: 'Browser module: page.on method' Registers a handler to be called whenever the specified event occurs. -| Parameter | Type | Default | Description | -| --------- | -------- | ------- | ----------------------------------------------------------------------------------- | -| event | string | `''` | Event to attach the handler to. Currently, only the `'console'` event is supported. | -| handler | function | `null` | A function to be called every time the specified event is emitted. | +| Parameter | Type | Default | Description | +| --------- | -------- | ------- | ------------------------------------------------------------------------------------------- | +| event | string | `''` | Event to attach the handler to. Currently, `'console'` and `'metric'` events are supported. | +| handler | function | `null` | A function to be called every time the specified event is emitted. | ### Events | Event | Description | | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `console` | Emitted every time the console API methods are called from within the page JavaScript context. The arguments passed into the handler are defined by the [`ConsoleMessage`](https://grafana.com/docs/k6//javascript-api/k6-browser/consolemessage) class. | +| `metric` | Emitted every time a metric is measured and emitted for the page. The arguments passed into the handler are defined by the [`MetricMessage`](https://grafana.com/docs/k6//javascript-api/k6-browser/metricmessage) class. | -### Example +### Console event Example {{< code >}} @@ -66,3 +67,62 @@ export default async function () { ``` {{< /code >}} + +### Metric event Example + +{{< code >}} + +```javascript +import { browser } from 'k6/browser'; + +export const options = { + scenarios: { + ui: { + executor: 'shared-iterations', + options: { + browser: { + type: 'chromium', + }, + }, + }, + }, +}; + +export default async function () { + const page = await browser.newPage(); + + // Here we call page.on('metric). It's possible to call page.on('metric') more + // than once, and the callback function will be executed in the order page.on + // was called. + page.on('metric', (metric) => { + // At the moment metric.tag is the only method on the metricMessage object. + // It will find a match between the current metric url and name tags against + // the supplied regular expression in `url`. + metric.tag({ + // This is the new name value that will replace the existing value in the + // url and name tags when a match is found. + name: 'test', + // You can provide multiple matches here. + matches: [ + { + url: /^https:\/\/test\.k6\.io\/\?q=[0-9a-z]+$/, + // When a method is defined it will also need to match on that too. If a + // method is not provided it will match on all method types. + method: 'GET', + }, + ], + }); + }); + + try { + // This is only for illustrative purposes, the q query param doesn't affect + // the website. + await page.goto('https://test.k6.io/?q=abc123'); + await page.goto('https://test.k6.io/?q=def456'); + } finally { + await page.close(); + } +} +``` + +{{< /code >}} From 2878661c89a505fd44e7c4216fe134783cca4793 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 8 Nov 2024 17:06:33 +0000 Subject: [PATCH 04/13] Update the MetricMessage description --- .../k6/next/javascript-api/k6-browser/metricmessage.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md index 2160bf05a5..eed4e714cb 100644 --- a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md +++ b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md @@ -7,7 +7,9 @@ weight: 03 # MetricMessage -`MetricMessage` objects are dispatched by page via registering a handler with [page.on('metric')](https://grafana.com/docs/k6//javascript-api/k6-browser/page/on). For each metric that it measured and emitted for the page, k6 browser delivers it to the registered handlers. +A `MetricMessage` object allows tagging of metrics that are measured and emitted for the page. + +`MetricMessage` objects are dispatched by the page when a handler is registered with [page.on('metric')](https://grafana.com/docs/k6//javascript-api/k6-browser/page/on). For each metric that is measured and emitted for the page, the k6 browser delivers a `MetricMessage` object to the registered handlers, allowing them to pattern match and tag metrics. ## tag From 20601ae02f33fea00b176970b6dc4d8c7b6d8ea1 Mon Sep 17 00:00:00 2001 From: Ankur Date: Fri, 8 Nov 2024 17:10:24 +0000 Subject: [PATCH 05/13] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: İnanç Gümüş --- .../k6/next/javascript-api/k6-browser/metricmessage.md | 2 +- docs/sources/k6/next/javascript-api/k6-browser/page/on.md | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md index eed4e714cb..951bff161a 100644 --- a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md +++ b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md @@ -13,7 +13,7 @@ A `MetricMessage` object allows tagging of metrics that are measured and emitted ## tag -The Metric Message exposes a single method, `tag`. It will match the given `matches` with the current metric's url and name tags. When a match is found it will use `name` to replace the existing url and name tag values. +The `tag` method matches the given `matches` with the current metric's url and name tags. When a match is found, it will use `name` to replace the existing url and name tag values. Doing this will help group metrics with disparate url and name tags, which are in fact referencing the same resource, so that a correlation can be found over time and preventing high cardinality issues in the backend database that is storing the metrics. diff --git a/docs/sources/k6/next/javascript-api/k6-browser/page/on.md b/docs/sources/k6/next/javascript-api/k6-browser/page/on.md index ed9da01bc5..b99f0a3847 100644 --- a/docs/sources/k6/next/javascript-api/k6-browser/page/on.md +++ b/docs/sources/k6/next/javascript-api/k6-browser/page/on.md @@ -95,9 +95,10 @@ export default async function () { // than once, and the callback function will be executed in the order page.on // was called. page.on('metric', (metric) => { + // Using metric.tag finds a match between the current metric url and name + // tags against the supplied regular expression in `url`. + // // At the moment metric.tag is the only method on the metricMessage object. - // It will find a match between the current metric url and name tags against - // the supplied regular expression in `url`. metric.tag({ // This is the new name value that will replace the existing value in the // url and name tags when a match is found. From f27607252bf72393d0a06e12f74220e71a2dba0e Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 8 Nov 2024 17:11:49 +0000 Subject: [PATCH 06/13] Update comment on page.on --- docs/sources/k6/next/javascript-api/k6-browser/page/on.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/sources/k6/next/javascript-api/k6-browser/page/on.md b/docs/sources/k6/next/javascript-api/k6-browser/page/on.md index b99f0a3847..66c6e10c76 100644 --- a/docs/sources/k6/next/javascript-api/k6-browser/page/on.md +++ b/docs/sources/k6/next/javascript-api/k6-browser/page/on.md @@ -91,9 +91,9 @@ export const options = { export default async function () { const page = await browser.newPage(); - // Here we call page.on('metric). It's possible to call page.on('metric') more - // than once, and the callback function will be executed in the order page.on - // was called. + // We first register a handler using page.on('metric'). Calling page.on('metric') + // multiple times is allowed. The registered handlers will be executed in the + // order page.on was called. page.on('metric', (metric) => { // Using metric.tag finds a match between the current metric url and name // tags against the supplied regular expression in `url`. From 98464b654fd8c72ea439cd061636d4d7489f0a1f Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 8 Nov 2024 17:13:19 +0000 Subject: [PATCH 07/13] Update tag description --- docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md index 951bff161a..75e2d0b7ed 100644 --- a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md +++ b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md @@ -15,7 +15,7 @@ A `MetricMessage` object allows tagging of metrics that are measured and emitted The `tag` method matches the given `matches` with the current metric's url and name tags. When a match is found, it will use `name` to replace the existing url and name tag values. -Doing this will help group metrics with disparate url and name tags, which are in fact referencing the same resource, so that a correlation can be found over time and preventing high cardinality issues in the backend database that is storing the metrics. +Doing this helps to group metrics with disparate url and name tags, which are, in fact, referencing the same resource so that a correlation can be found over time and to reduce the cardinality of the metrics. From f45cda8df1d61df4e201f0a01f6ec8194916ed27 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 8 Nov 2024 17:14:31 +0000 Subject: [PATCH 08/13] Update from class to object --- docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md | 2 +- docs/sources/k6/next/javascript-api/k6-browser/page/on.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md index 75e2d0b7ed..d462fac429 100644 --- a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md +++ b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md @@ -1,7 +1,7 @@ --- title: 'MetricMessage' slug: 'metricmessage' -description: 'Browser module: MetricMessage Class' +description: 'Browser module: MetricMessage Object' weight: 03 --- diff --git a/docs/sources/k6/next/javascript-api/k6-browser/page/on.md b/docs/sources/k6/next/javascript-api/k6-browser/page/on.md index 66c6e10c76..715b099f6f 100644 --- a/docs/sources/k6/next/javascript-api/k6-browser/page/on.md +++ b/docs/sources/k6/next/javascript-api/k6-browser/page/on.md @@ -17,7 +17,7 @@ Registers a handler to be called whenever the specified event occurs. | Event | Description | | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `console` | Emitted every time the console API methods are called from within the page JavaScript context. The arguments passed into the handler are defined by the [`ConsoleMessage`](https://grafana.com/docs/k6//javascript-api/k6-browser/consolemessage) class. | -| `metric` | Emitted every time a metric is measured and emitted for the page. The arguments passed into the handler are defined by the [`MetricMessage`](https://grafana.com/docs/k6//javascript-api/k6-browser/metricmessage) class. | +| `metric` | Emitted every time a metric is measured and emitted for the page. The arguments passed into the handler are defined by the [`MetricMessage`](https://grafana.com/docs/k6//javascript-api/k6-browser/metricmessage) object. | ### Console event Example From 3baf38691cea0e84ba92bad652d60e47bed7117b Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 11 Nov 2024 09:11:10 +0000 Subject: [PATCH 09/13] Remove the slug --- docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md index d462fac429..5ebd398c9c 100644 --- a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md +++ b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md @@ -1,6 +1,5 @@ --- title: 'MetricMessage' -slug: 'metricmessage' description: 'Browser module: MetricMessage Object' weight: 03 --- From f52b280b721f04a7eaab59dea411188c71be3679 Mon Sep 17 00:00:00 2001 From: Ankur Date: Mon, 11 Nov 2024 09:12:58 +0000 Subject: [PATCH 10/13] Apply suggestions from code review Co-authored-by: Heitor Tashiro Sergent --- .../k6/next/javascript-api/k6-browser/metricmessage.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md index 5ebd398c9c..163a2999cd 100644 --- a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md +++ b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md @@ -8,13 +8,13 @@ weight: 03 A `MetricMessage` object allows tagging of metrics that are measured and emitted for the page. -`MetricMessage` objects are dispatched by the page when a handler is registered with [page.on('metric')](https://grafana.com/docs/k6//javascript-api/k6-browser/page/on). For each metric that is measured and emitted for the page, the k6 browser delivers a `MetricMessage` object to the registered handlers, allowing them to pattern match and tag metrics. +`MetricMessage` objects are dispatched by the page when a handler is registered with [page.on('metric')](https://grafana.com/docs/k6//javascript-api/k6-browser/page/on). For each metric that is measured and emitted for the page, the k6 browser module delivers a `MetricMessage` object to the registered handlers, allowing them to pattern match and tag metrics. ## tag -The `tag` method matches the given `matches` with the current metric's url and name tags. When a match is found, it will use `name` to replace the existing url and name tag values. +The `tag` method matches the given `matches` with the current metric's url and name tags. When a match is found, it will use `name` to replace the existing URL and name tag values. -Doing this helps to group metrics with disparate url and name tags, which are, in fact, referencing the same resource so that a correlation can be found over time and to reduce the cardinality of the metrics. +Doing this helps group metrics with different URL and name tags, which are, in fact, referencing the same resource so that a correlation can be found over time and to reduce the cardinality of the metrics. From d1f8377778213e55b22377030d206df70bdab153 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 11 Nov 2024 09:18:22 +0000 Subject: [PATCH 11/13] Add tagMatch description --- docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md index 163a2999cd..73037ccc00 100644 --- a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md +++ b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md @@ -20,7 +20,7 @@ Doing this helps group metrics with different URL and name tags, which are, in f | Parameter | Type | Description | | ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| tagMatch | object | It is required. | +| tagMatch | object | It is required. The tagMatch object and its properties that are used for matching metrics. | | tagMatch.name | string | It is a required field and it must not be an empty string. It will replace the current metric's url and name tag values when a match is found. | | tagMatch.matches | object[] | It is a required field. It is an array of objects containing the regular expression and optional method to match against the current metric's url and name tags. It will iterate over all the objects in `matches` until a match is found, or to the end of the array if no match is found. | | tagMatch.matches.url | RegExp | It is a required field. It is used to match against the current metric url and name tags. | From 152d0b3df5d63a1969cd863a54886a16170f9801 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 11 Nov 2024 09:26:40 +0000 Subject: [PATCH 12/13] Update the field descriptions --- .../javascript-api/k6-browser/metricmessage.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md index 73037ccc00..a06c5687f7 100644 --- a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md +++ b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md @@ -18,13 +18,13 @@ Doing this helps group metrics with different URL and name tags, which are, in f -| Parameter | Type | Description | -| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| tagMatch | object | It is required. The tagMatch object and its properties that are used for matching metrics. | -| tagMatch.name | string | It is a required field and it must not be an empty string. It will replace the current metric's url and name tag values when a match is found. | -| tagMatch.matches | object[] | It is a required field. It is an array of objects containing the regular expression and optional method to match against the current metric's url and name tags. It will iterate over all the objects in `matches` until a match is found, or to the end of the array if no match is found. | -| tagMatch.matches.url | RegExp | It is a required field. It is used to match against the current metric url and name tags. | -| tagMatch.matches.method | string | It is optional. When it is not set, a match will occur on all method types. When it is set, it will match on the one method that is set. Valid values are `'GET'`, `'POST'`, `'PUT'`, `'DELETE'`, `'PATCH'`, `'OPTIONS'`, `'HEAD'`, `'TRACE'` and `'CONNECT'` | +| Parameter | Type | Description | +| ----------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| tagMatch | object | The tagMatch object and its properties that are used for matching metrics. Required. | +| tagMatch.name | string | The name value that replaces the current metric's URL and name tag values, if a match is found. Required, and must not be an empty string. | +| tagMatch.matches | object[] | An array of objects containing the matchers which will be used to match against the current metric's URL and name tags. Required. | +| tagMatch.matches.url | RegExp | The regular expression used to find matches in the current metric's URL and name tags. Required. | +| tagMatch.matches.method | string? | Used to match the metric's method tag. Valid values are `'GET'`, `'POST'`, `'PUT'`, `'DELETE'`, `'PATCH'`, `'OPTIONS'`, `'HEAD'`, `'TRACE'` and `'CONNECT'`. It's optional, and when it's not set it will group all metrics regardless of the method tag. | From 42a5c0eb879a3733d410daf4fcda2fccc92fd145 Mon Sep 17 00:00:00 2001 From: ankur22 Date: Mon, 11 Nov 2024 09:32:16 +0000 Subject: [PATCH 13/13] Update the tag description --- docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md index a06c5687f7..71d5416de7 100644 --- a/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md +++ b/docs/sources/k6/next/javascript-api/k6-browser/metricmessage.md @@ -14,7 +14,7 @@ A `MetricMessage` object allows tagging of metrics that are measured and emitted The `tag` method matches the given `matches` with the current metric's url and name tags. When a match is found, it will use `name` to replace the existing URL and name tag values. -Doing this helps group metrics with different URL and name tags, which are, in fact, referencing the same resource so that a correlation can be found over time and to reduce the cardinality of the metrics. +Doing this helps group metrics with different URL and name tags that, in fact, reference the same resource, allowing for correlation over time and reducing the cardinality of the metrics.