-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update CreateDashboard Script #26
Conversation
We have added the feature of being able to run `vigilo` in a Kubernetes cluster which means the host tag sent to DataDog will be 'docker-container'. Therefore, let's use an environment variable to configure the host query parameter.
We will be adding a Query Value widget to the dashboard so we will need to add alerts to said widget. Let's differentiate between the Timeseries and Query Value alerts and add the new Query Value alerts
Similar to the timeseries request function, we will create a new function to handle the creation of requests for the query value widget. One thing to note, unlike the timeseries widget, the query value widget implements the alerts through the requests definition.
We've updated the lighthouse metrics to send both a 'score' and 'value' datapoint for each audit. As such we need to update the queries to specify the new subpath. For most of the audits, the 'value' datapoint is more useful than the 'score' datapoint. The only audits that we would use the 'score' datapoint are those with null 'value' datapoints like the 'is_crawlable' audit.
Similar to the Timeseries widget function, this adds a new function to create a Query Value widget.
We will need to pair up the query value widget and timeseries widget together in the same row. On top of that, we don't want the widgets to expand the full width. Therefore, we will pass a parameter to modify the size and position of the widgets.
This modifies the createWidgetForAllPageTypes function to create a query value widget at the same time as the timeseries widget. On top of that, we will keep track of the position of the widgets to layout them out properly per group.
This adds a custom link to the timeseries widgets such that we can link the actual webpage for the datapoint being displayed. This will make it convenient to debug and investigate the data without having to manually type out the URL.
QA 🎬
|
For some of the audits, we weren't scaling the comparator value to the correct unit types of the metrics being sent. Most of the metrics are in milliseconds, so we need to scale the comparator value to milliseconds as well as these values assumed the metric was in seconds.
The alert display type is CamelCase, not snake_case. This caused the warning marker to not have the correct display type.
un_deploy_block ⚡ The other graphs within the groups do have the |
un_deploy_block 🦕 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't pretend to understand all of the queries. I think QA is more important there.
The code seems sane. CR 📱
"display_type": "warning dashed" | ||
} | ||
] : [] | ||
} | ||
|
||
function fetchQueryValueAlertMarkersForAudit(auditName: string) { | ||
return ALERT_MARKERS_QUERY_VALUE.hasOwnProperty(auditName) ? ALERT_MARKERS_QUERY_VALUE[auditName] : [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see us using hasOwnProperty
in a few places. Can't we simplify this?
return ALERT_MARKERS_QUERY_VALUE[auditName] ?? []
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, this whole script could be improved and simplified. I thought about refactoring it by using a Factory design pattern but that is quite the over haul for the scope of the issue.
Description
There have been quite a few changes to the underlying core logic. This has affected the metrics being sent to DataDog which in turn means the dashboards created through the
createDashboard
script are now outdated and ineffective.The
createDashboard
script has been revised in this update to enhance the efficiency and functionality of the dashboards it generates.CR
This mainly adds a new
Query Value
widget to the dashboard building logic. The newQuery Value
widget provides an average for all URLs of each page type, facilitating quick issue identification and correlation with data points. In contrast, theTimeseries
widget is more useful at tracking changes over time for each URL. Additionally, theTimeseries
widget has been enhanced to easily incorporatecustomLinks
, allowing for direct access to relevant pages associated with the data points.QA
pnpm create-dashboard
now creates a dashboard that shows the data properlyTimeseries
widget the datapoints have aVisit Webpage
link that will take you to the actual webpage that was audited.Closes: https://github.com/iFixit/ifixit/issues/51901