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

Add page.on('metric') docs #1807

Merged
merged 13 commits into from
Nov 11, 2024
Merged

Add page.on('metric') docs #1807

merged 13 commits into from
Nov 11, 2024

Conversation

ankur22
Copy link
Contributor

@ankur22 ankur22 commented Nov 8, 2024

What?

This adds the docs for page.on('metric'), which is a new API in the browser module.

Checklist

  • I have used a meaningful title for the PR.
  • I have described the changes I've made in the "What?" section above.
  • I have performed a self-review of my changes.
  • I have run the npm start command locally and verified that the changes look good.
  • I have made my changes in the docs/sources/next folder of the documentation.

Related PR(s)/Issue(s)

grafana/xk6-browser#371, grafana/xk6-browser#1487

Copy link
Member

@inancgumus inancgumus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀 Some suggestions.

Copy link
Collaborator

@heitortsergent heitortsergent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments with some small edits. I think the biggest thing might be tweaking the descriptions of the properties just a bit. 🤓

@@ -0,0 +1,60 @@
---
title: 'MetricMessage'
slug: 'metricmessage'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
slug: 'metricmessage'

If the URL is going to be the same name as the filename, you don't need the slug property here. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, removed in 3baf386


| Parameter | Type | Description |
| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| tagMatch | object | It is required. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we include something more descriptive here? Maybe "The tagMatch object and its properties that are used for matching metrics. Required."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, added in d1f8377

| 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. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little bit confused by this description and the following ones as well. 🤔

What happens with the value of this property? I'm wondering if we could tweak the description for this and the following values to be something along the lines of: "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."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made the change, WDYT? 152d0b3

@ankur22
Copy link
Contributor Author

ankur22 commented Nov 11, 2024

@heitortsergent i've merged this PR in for now. Any new feedback I will work on in a new PR. 🙇

@ankur22 ankur22 merged commit 5f4e1e4 into main Nov 11, 2024
3 of 4 checks passed
@ankur22 ankur22 deleted the add/page-on-metric branch November 11, 2024 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants