Support metrics dashboard query parameters in GFM metrics filter
What does this MR do?
Part of of series of MRs to cleanup & add support for embedding specific metrics in markdown!
This MR
This particular MR adds support for several params on from the metrics embed filter of the GFM pipeline - group
, title
, and y_label
. Together with the dashboard
param, these params provide enough information to uniquely identify a chart on the metrics dashboard.
Flow overview:
- A link to the metrics dashboard is recognized in the description of a markdown field
- A link to the dashboard layout is generated and inserted into the markdown as a placeholder
- The FE requests a page with a markdown field (like an issue)
- The FE recognizes the placeholder & fetches the dashboard layout and all required data
The following url should render a metrics chart on environments which have prometheus configured:
https://gitlab.example.com/user/project-name/environments/id/metrics?dashboard=config%2Fprometheus%2Fcommon_metrics.yml&group=System%20metrics%20(Kubernetes)&title=Core%20Usage%20(Pod%20Average)&y_label=Cores%20per%20Pod
Default case still works! | New format also works! |
---|---|
Context
Prior context: https://gitlab.com/gitlab-org/gitlab-ce/issues/30423 introduced a default embed.
The below MRs are all part of this work:
-
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31006 - Move dashboard services to /services
subdirectory & renameDynamicDashboardService
toDefaultEmbedService
-
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31157 - Fix embeds caching bug -
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31063 - Introduce support for fetching a specific embed -
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31304 - Add support for dashboard params in GFM pipeline
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry for user-facing changes, or community contribution. Check the link for other scenarios. - [-] Documentation created/updated or follow-up review issue created
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content