def prom_metrics(): """ Collect the stats and send back to the caller""" stats = GatewayStats() stats.collect() return Response(stats.formatted(), content_type="text/plain")
def prom_metrics(): """ Collect the stats and send back to the caller""" stats = GatewayStats() try: stats.collect() except CephiSCSIInval as err: return jsonify(message="Could not get metrics: {}".format(err)), 404 return Response(stats.formatted(), content_type="text/plain")