Make dashboards tenant-aware
@cfeick said in slack:
Is the idea that tenants attribute in https://gitlab.com/gitlab-com/runbooks/-/blob/master/libsonnet/servicemetrics/service_definition.libsonnet#L36 will eventually also be used for automatically loading correct tenant datasource on service overview dashboards in https://gitlab.com/gitlab-com/runbooks/-/blob/master/libsonnet/gitlab-dashboards/service_dashboard.libsonnet? eg https://gitlab.com/gitlab-com/runbooks/-/blob/master/libsonnet/grafana/basic.libsonnet#L261
We had some conversation around it as well.
The default data source is set here: https://gitlab.com/gitlab-com/runbooks/-/blob/master/metrics-catalog/gitlab-metrics-config.libsonnet#L54
We can make a map between tenant name and modify the template (https://gitlab.com/gitlab-com/runbooks/-/blob/41990c380c5760e81f191012fc6d1a9af6868c19/libsonnet/grafana/templates.libsonnet#L43-48) to take in a current argument, then set https://gitlab.com/gitlab-com/runbooks/-/blob/41990c380c5760e81f191012fc6d1a9af6868c19/libsonnet/gitlab-dashboards/service_dashboard.libsonnet#L94-100 to get the data source name.
Most services are targeting more than one tenant, so it might make sense to use the first tenant on the list and provide a tenant aware drop down list?
It would probably also be useful to potentially have this something we could turn on service by service.