Hide ability to create alert by checking if metric is added to the DB
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 |
---|---|
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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)