Skip to content

WIP: Import custom dashboard metrics into the DB

Sarah Yasonik requested to merge ingest-dashboard into master

What does this MR do?

Issue: #28241 (closed)

I'd like to break this work up into a bunch of tinier pieces. The list below roughly reflects how I'm planning to do that.

Issue Content

Phase 1

  • Update identifier uniqueness? Use composite identifier?

Phase 2

  • Add ingestor
  • Use ingestor on file change

Phase 3

  • Possibility: Add validator
  • Possibility: Include validation on ingest
  • Remove orphaned metrics on ingest
  • Remove orphaned alerts on metric ingest

Phase 4

  • Handle alert reset on dashboard updates

Phase 5

  • Reset alerts with prometheus/cluster

Bonus Refactors

  • Move services which return dashboards into own directory
  • Rename components across services -> Consistency with project/custom !27431 (merged), !27433 (merged)
  • Separate all_dashboards from metrics_dashboard

Scenarios I want to make sure we've considered:

Simple dashboard uploads
  1. Cluster is attached
  2. Prometheus is installed
  3. Dashboard is uploaded for the first time

Expect => Metrics to be uploaded

  1. Cluster is attached
  2. Dashboard is uploaded for the first time
  3. Prometheus is installed

Expect => Metrics to be uploaded

  1. Dashboard is uploaded for the first time
  2. Cluster is attached
  3. Prometheus is installed

Expect => Metrics to be uploaded

  1. Cluster is attached
  2. Prometheus is installed
  3. Dashboard is uploaded for the first time
  4. Prometheus is uninstalled
  5. Prometheus is reinstalled

Expect => Metrics to be uploaded

  1. Cluster is attached
  2. Prometheus is installed
  3. Dashboard is uploaded for the first time
  4. Cluster is removed
  5. Cluster is added
  6. Prometheus is installed

Expect => Metrics to be uploaded

Dashboard upload & re-upload
  1. Cluster is attached
  2. Prometheus is installed
  3. Dashboard is uploaded for the first time
  4. Dashboard is uploaded with changes

Expect => Metrics to be uploaded & displayed with new content

  1. Dashboard is uploaded for the first time
  2. Cluster is attached
  3. Prometheus is installed
  4. Dashboard is uploaded with changes

Expect => Metrics to be uploaded & displayed with new content

  1. Dashboard is uploaded for the first time
  2. Cluster is attached
  3. Prometheus is installed
  4. Dashboard is uploaded with changes

Expect => Metrics to be uploaded & displayed with new content

Simple upload & configuring alert
  1. Cluster is attached
  2. Prometheus is installed
  3. Dashboard is uploaded for the first time
  4. Alert is added

Expect => Metrics to be uploaded; Alerts to be configured on Prometheus

  1. Dashboard is uploaded for the first time
  2. Cluster is attached
  3. Prometheus is installed
  4. Alert is added
  5. Prometheus is uninstalled
  6. Prometheus is reinstalled

Expect => Metrics to be uploaded; ALERT IS NOT CONFIGURED

  1. Cluster is attached
  2. Prometheus is installed
  3. Dashboard is uploaded for the first time
  4. Cluster is removed
  5. Cluster is added
  6. Prometheus is installed

Expect => Metrics to be uploaded; ALERT IS NOT CONFIGURED

Upload, re-upload, and configuring alert
  1. Cluster is attached
  2. Prometheus is installed
  3. Dashboard is uploaded for the first time
  4. Alert is added
  5. Dashboard is uploaded with changes to UI elements (title, y_label, etc)

Expect => Metrics to be uploaded & displayed with new content; Alert persists unchanged

  1. Cluster is attached
  2. Prometheus is installed
  3. Dashboard is uploaded for the first time
  4. Alert is added
  5. Dashboard is uploaded with changes to query

Expect => Metrics to be uploaded & displayed with new content; Alert is updated to trigger on new query

  1. Cluster is attached
  2. Prometheus is installed
  3. Dashboard is uploaded for the first time
  4. Alert is added
  5. Prometheus is uninstalled
  6. Prometheus is reinstalled

Expect => Metrics to be uploaded; ALERT IS NOT CONFIGURED

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by 🤖 GitLab Bot 🤖

Merge request reports