json generation with metrics