Skip to content

Add issue prefilling support for o11y metrics

Max Woolf requested to merge 2886/opstrace/prefil-metric-issues into master

What does this MR do and why?

  • Adds support for prefilling issue titles and descriptions with metric information.

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Enable feature flag observability_features

  2. Ensure you have a working Ultimate licence.

  3. Create a new group, and project within it.

  4. Create a new issue by visiting the issues/new page with the correct urlencoded payload. Here's an example:

    /new?observability_metric_details={"fullUrl"%3A"http%3A%2F%2Fgdk.test%3A3000%2Fgitlab-org%2Fgitlab-test%2F-%2Fmetrics%2Fapp.ads.ad_requests%3Ftype%3DSum%26date_range%3D1h%26group_by_fn%3Dsum%26group_by_attrs[]%3Dapp.ads.ad_request_type%26group_by_attrs[]%3Dapp.ads.ad_response_type"%2C"name"%3A"app.ads.ad_requests"%2C"type"%3A"Sum"%2C"dimensions"%3A["app.ads.ad_request_type"%2C"app.ads.ad_response_type"]%2C"timeframe"%3A["2024-07-2504%3A47%3A00UTC"%2C"2024-07-2505%3A47%3A00UTC"]%2C"latestValues"%3A["app.ads.ad_request_type%3ANOT_TARGETED%2Capp.ads.ad_response_type%3ARANDOM%3A281.000"%2C"app.ads.ad_request_type%3ATARGETED%2Capp.ads.ad_response_type%3ATARGETED%3A1387.000"%2C"app.ads.ad_request_type%3ATARGETED%2Capp.ads.ad_response_type%3ARANDOM%3A287.000"]}

    Note: This issue will add a button that generates and links that payload automatically.

  5. Ensure that the issue is prefilled with a title that looks like Issue created from app.ads.ad_requests

  6. Ensure that the issue is prefilled with the description 👇

    [Metric details](http://gdk.test:3000/gitlab-org/gitlab-test/-/metrics/app.ads.ad_requests?type=Sum&date_range=1h&group_by_fn=sum&group_by_attrs[]=app.ads.ad_request_type&group_by_attrs[]=app.ads.ad_response_type) \
    Name: `app.ads.ad_requests` \
    Type: `Sum` \
    Timeframe: `2024-07-2504:47:00UTC - 2024-07-2505:47:00UTC`

Relates to gitlab-org/opstrace/opstrace#2886

Edited by Max Woolf

Merge request reports