Skip to content

Hide ability to create alert by checking if metric is added to the DB

Miguel Rincon requested to merge 204796-hide-create-alert-on-custom-metrics into master

Background

In monitoring metrics can be added from the UI and from yml files. The metrics added in the UI support more features, such as alerts, because they are stored in the database.

yml based metrics should have a more limited feature set.

What does this MR do?

Previously, custom metrics stored in the database where identified by having an id, this was used to know if an alert could be added to them.

Recently we added ids to all our metrics in the frontend so we can manipulate them in the same way. This had the drawback that we cannot identify which metrics where stored in the database, this MR reverts this situation but having a getter to identify them.

This is a temporary solution until all metrics get stored in the database, and can have alerts on them (#194267 (closed)).

Screenshots

database based metrics have alerts yml based metrics have no alerts
Screen_Shot_2020-03-27_at_5.59.12_PM Screen_Shot_2020-03-27_at_5.59.59_PM

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

Closes #204796 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports