Created
May 28, 2018 19:20
-
-
Save SirEdvin/c41461c82dd2b2c32e42a49df79293a2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sanic import Sanic | |
from sanic.response import json | |
from prometheus_client import Counter | |
from sanic_prometheus import monitor | |
c1 = Counter('simple_counter', "Just simple counter") | |
app = Sanic("snippet") | |
monitor(app).expose_endpoint() | |
@app.get('/') | |
async def test(response): | |
c1.inc() | |
return json({'message': "cute"}) | |
if __name__ == '__main__': | |
app.run(host='127.0.0.1', port='8889', debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment