Skip to content

Support multiple queries on a single chart in Metrics

Sarah Yasonik requested to merge minimized-multiple-queries into master

What does this MR do?

  • Groups metrics based on shared attributes (y_label, group, and title) in the UI.
  • Supports create/read/update/delete actions for multiple metrics per alert dropdown

CE Port

What's still missing?

Some screenshots

multiple queries existing alert alert dropdown empty alert new alert
Screen_Shot_2019-02-26_at_4.31.02_PM Screen_Shot_2019-02-26_at_4.31.32_PM Screen_Shot_2019-02-26_at_4.31.24_PM Screen_Shot_2019-02-26_at_4.31.14_PM Screen_Shot_2019-02-26_at_4.31.41_PM

Local Testing

Prereqs: A project running Prometheus w/ deployed envs (follow setup instructions then create an MR)

  1. Checkout branch
  2. Open rails c
  3. Check that you have n metrics locally: Run PrometheusMetric.count
  4. Add a new query to one of the existing metrics in common_metrics.yml (I just copy & paste one then multiple it by 0.85)
  5. Run:
require Rails.root.join('db/importers/common_metrics_importer.rb')
Importers::CommonMetricsImporter.new.execute
  1. Confirm that you now have n+1 metrics: Run PrometheusMetric.count
  2. Navigate to the monitoring page for your environment (Operations > Environments > tiny chart icon || Show More > tiny chart icon)
  3. You should already see an additional line on your first graph which just represents 85% of the value of the chart.
  4. Cleanup: Run PrometheusMetric.last.destroy

What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ce/issues/54877

Does this MR meet the acceptance criteria?

Edited by Adriel Santiago

Merge request reports