Add custom metrics form to dashboard
What does this MR do?
Allows adding custom metrics from the metrics dashboard:
CE Backport
Local Testing
- Enable the metrics dashboard Using Prometheus with GDK
- Find the project id of your autodevops project on the
Project > Details
Page just beneath the project name:
project id |
---|
![]() |
- Run the following commands in the rails console (
rails c
) replacing<PROJECT_ID>
with the project Id found in the previous step:
p = PrometheusService.find_by(project_id: <PROJECT_ID>)
p.update_attributes!(active: true)
-
Ensure you have a Premium license or above installed and that you are logged in as an
admin
or havemaintainer
level access to your autodevops project. -
You should now be able to add custom metrics in the project settings found at
Settings > Integrations > Prometheus
and also from the metrics dashboard.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance 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
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 #4452 (closed)
Edited by Adriel Santiago