use json to make metrics serializable