Skip to content

Support metrics dashboard query parameters in GFM metrics filter

Sarah Yasonik requested to merge enable-specific-embeds into master

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!
Screen_Shot_2019-08-08_at_4.29.21_PM Screen_Shot_2019-08-08_at_4.29.08_PM

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:

Does this MR meet the acceptance criteria?

Conformity

Performance and testing

Edited by Sarah Yasonik

Merge request reports