Add db_config_name label to prometheus database metrics
The sharding team is adding support for multiple databases and in order for us to have good visibility into performance we'll want to be able to distinguish between the different databases in our prometheus metrics. Adding a prometheus label allows us to filter/group by the different databases. By default there will only be 1 `db_config_name` which is `primary` by default. But this is configured by `config/database.yml` and in future there will be 2 databases called `main` and `ci`. This MR also ensures the new label is disabled by default to allow us to introduce this to production in a slightly more controlled way. We opted to use an environment variable instead of feature flag in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/66885 because it's too expensive to query the databases so frequently to check the feature flag value.
Showing
Please register or sign in to comment