Merge "Reuse error mapping logic for key operation metrics" into main