Skip to content

Commit

Permalink
Trace get products route
Browse files Browse the repository at this point in the history
  • Loading branch information
italovieira committed Apr 18, 2021
1 parent bec1661 commit 3873fe2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/routes/product.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from flask_restful import Resource, reqparse
from ..dao.product import ProductDAO
from tracing import init_tracer
from decorators import trace

_dao = ProductDAO()

Expand All @@ -8,6 +10,7 @@
parser.add_argument('price', type=float, required=True)
parser.add_argument('available', type=int, required=True)

tracer = init_tracer('product route')

class ProductRoute(Resource):
def get(self, _id):
Expand All @@ -22,6 +25,7 @@ def delete(self, _id):


class ProductListRoute(Resource):
@trace(tracer, 'get products')
def get(self):
return _dao.get_all()

Expand Down

0 comments on commit 3873fe2

Please sign in to comment.