Specify time frame in shareable link for embedding metrics
Problem to solve
We will have added the ability to embed specific metrics charts in issues (https://gitlab.com/gitlab-org/gitlab-ce/issues/30423) in
12.1 so that user can link relevant changes in data to incidents that have happened. This enables them to share knowledge and collaborate with others during the fire-fight. These charts are only useful when the time series data is scoped to an appropriate time frame which depends on incident in question. We want to give users the ability to set a time frame for a particular metric chart when they embed it in an issue, so that they can refer back the change that initially caused the incident which is necessary in root cause analyses and post incident reviews.
This work contributes to the Incident Management Vision
- Set the time range on the existing time drop-down on the original dashboard
- Generate the link to the metric or copy the dashboard URL from the browser in the case of the MVC. The link will include the time range. (This functionality is standard in other chart tools, including Grafana, so there is precedent for it)
- Paste the generated link into the issue
- If needed, manually edit the time range in the generated link to change the time range, or revisit the dashboard and generate a new link after changing the time range in the dashboard.
- Display empty-state messaging if a user edits the URL for a time frame that is in the future or outside the data retention window for that customer's prometheus instance.