Add migration to import common metrics
What does this MR do?
Add a migration to import the new common metrics queries after they were updated to work with the pod/container labels as well as the older pod_name/container_name labels.
This migration won't change any table structure. It will import the Prometheus queries in the config/prometheus/common_metrics.yml
file into the prometheus_metrics
table.
This migration needs to be executed every time there is a change to the queries in config/prometheus/common_metrics.yml
.
Up migration:
== 20200813153434 ImportLatestCommonMetrics: migrating ========================
== 20200813153434 ImportLatestCommonMetrics: migrated (0.0787s) ===============
Down migration:
== 20200813153434 ImportLatestCommonMetrics: reverting ========================
== 20200813153434 ImportLatestCommonMetrics: reverted (0.0000s) ===============
22 rows in prometheus_metrics
table will be inserted/updated. The prometheus_metrics
table on gitlab.com has ~908 rows.
This migration should take less than a second on gitlab.com since the number of rows being updated are very low.
Screenshots
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