Ejemplo n.º 1
0
def prom_metrics():
    """ Collect the stats and send back to the caller"""

    stats = GatewayStats()
    stats.collect()

    return Response(stats.formatted(), content_type="text/plain")
Ejemplo n.º 2
0
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")