Set the cluster label when the value is not provided explicitly

Description

Problem

For the purpose of displaying services in PMM in the cluster view, or hierarchy, we need to make sure that the `cluster` label be set at all times. However, this label is not required and we don't see the need to make it required yet.

Solution

When the user adds a service to PMM, we want to implicitly set the `cluster` label, if it's not provided by the user, to the same value as the service name.

 

How to test

Case 1: label `cluster is provided by the user`

1/ add a mysql service to PMM

2/ assert that the label `cluster` matches the value provided by the user

 

Case 2: label `cluster is not provided by the user`

1/ add a mysql service to PMM

2/ assert that the label `cluster` matches the service name

 

Note: this can be tested on any database supported by PMM.

How to document

For the purpose of Inventory Cluster View, we will be treating single database instances as single-node database clusters.

With this feature we are making sure that the `cluster` label is always set, since some PMM features will rely on it, namely the inventory cluster view and the backups.

If not provided by the user, the `cluster` label takes the value of `service_name`, otherwise it is assigned the value provided by the user. In the future, once cluster topology detection kicks in, it will take the cluster name assigned to the database cluster at creation time.

Early capture recording
https://drive.google.com/file/d/1TE-MHPmZ8OfH0Ja3RO8jeIvKLeqOr6M8/view

100% Done
Loading...

Activity

Show:

saikumar.vs September 13, 2023 at 7:31 AM

verified, please see test scenarios section for more details.

Done

Details

Assignee

Reporter

Priority

Components

Needs QA

Yes

Needs Doc

Yes

Planned Version/s

Fix versions

Story Points

Smart Checklist

Created February 16, 2023 at 12:03 PM
Updated March 5, 2024 at 11:58 PM
Resolved September 26, 2023 at 10:00 AM