How to close all the related metric instances of a record when it is closed?
Out Of the box, there is a field value duration metric definition configured for the incident table on the field "Active". Though it is a field value duration, there is a script which handles to close out (end) other metrics when the active flag in the incident turns false.
This metric definition is responsible to close or mark calculation complete as true for any other metric instances on the incident table when the incident is closed.
If you want the same functionality on other tables, you would need to configure similar definition on respective tables as well.