Embed metrics snapshot into issue description
What does this MR do and why?
Add ability to take screenshot of the metrics chart and embed it into the linked issue.
- Add modern-screenshot dependency. This has been evaluated as part of !152190 (closed) and #460470 (comment 1894400992)
- Add
uploadImageToProjectunderprojects_apito handle uploading files to project's/uploads - Upon selecting the "Create Issue" button, a snapshot of the metrics chart is taken and uploaded, and the shared URL is passed to the creation issue API
- Extend metrics issue creation API to embed the image in the description upon receiving the relevant parameter
Based on previous spikes:
- Draft: Spike share visualizations using screens... (!151366 - closed)
- Add download image action to dashboard panels (#460470)
- Draft: [SPIKE] Add image share & download to an... (!152190 - closed)
Related to Embed metrics snapshot into issue description (gitlab-org/opstrace/opstrace#2717 - closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
| Scenario | Video |
|---|---|
| Create snapshot from metric | Screen_Recording_2024-09-24_at_14.53.49 |
| Create snapshot from histogram | Screen_Recording_2024-09-24_at_14.54.59 |
| Snapshot creation fails | Screen_Recording_2024-09-24_at_15.01.11 |
How to set up and validate locally
- You need a GitLab Ultimate license.
- Enable the
:observability_featuresfeature flag enabled. - Follow the one of the
GitLab Observability development setupsteps in the development documentation. - View the metrics list page at Projects > Monitor > Metrics.
- Select a metric and create a new issue through the dedicated button
Edited by Robert Hunt
