Skip to content

Use metric step if present

Ryan Cobb requested to merge rc/use_metric_step into master

What does this MR do?

Fixes #212491 (closed)

Currently in our monitoring dashboard solution, when we provide queries that aggregate data in say one day at a time and that generates a data point, we should plot the aggregated data by the interval provided by the query.

This is because we currently calculate step https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/monitoring/stores/actions.js#L147. Grafana gets around this by automatically setting step to interval. We may do this in future iterations.

This MR allows us to use step when it is defined in a dashboard yml. The step key is automatically parsed in the backend, sent to the frontend and kept in the store, we just needed to use it.

An example dashboard yml

dashboard: general SLAs
panel_groups:
- group: Headline
  panels:
  - title: Weighted Availability Score - GitLab.com
    max_value: 1
    metrics:
    - id: single-stat-weighted-availability
      label: Weighted Availability Score - GitLab.com
      query: avg_over_time(sla:gitlab:ratio{environment="gprd", stage="main"}[3m])
      unit: "%"
      step: 10

Documentation MR: !29194 (diffs)

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