Create dashboard showing package states
Problem description
The delivery_auto_deploy_package_state metric tells us the state of each auto deploy package (different packages are identified by the version label). Unfortunately, we cannot use this since this metric shows status of all packages, not just the latest ones.
Proposal
Create a new metric for tracking the status of packages that are currently building, and that are newer than the package on gstg-cny.
We need a dashboard that shows:
- The percentage of time where gstg-cny was idle (
delivery_auto_deploy_environment_state{target_env='gstg',target_stage='cny',env_state='ready'}) and the different package states. For example, what percentage of time was gstg-cny idle and a package wasbuilding. - A visualization showing the different package states.
If the new metric is named delivery_auto_deploy_new_package_state, the following should give us the intersection of gstg-cny being idle with packages in different state of being built.
(max by (pkg_state) (delivery_auto_deploy_building_package_state)) * on() group_left max(delivery_auto_deploy_environment_state{target_env="gstg",target_stage="cny",env_state="ready"})