Skip to content

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 uploadImageToProject under projects_api to 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:

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

image

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

  1. You need a GitLab Ultimate license.
  2. Enable the :observability_features feature flag enabled.
  3. Follow the one of the GitLab Observability development setup steps in the development documentation.
  4. View the metrics list page at Projects > Monitor > Metrics.
  5. Select a metric and create a new issue through the dedicated button
Edited by Robert Hunt

Merge request reports

Loading