Wrap API and registry requests with common metric timings
Record response times, codes, and rollup non-2XX responses.
This commit is contained in:
parent
b04c190ca0
commit
b483209862
4 changed files with 48 additions and 4 deletions
|
@ -7,6 +7,7 @@ from flask import Blueprint, make_response, url_for, request
|
|||
from functools import wraps
|
||||
from urlparse import urlparse
|
||||
|
||||
from app import metric_queue
|
||||
from endpoints.decorators import anon_protect, anon_allowed
|
||||
from auth.jwt_auth import process_jwt_auth
|
||||
from auth.auth_context import get_grant_user_context
|
||||
|
@ -14,12 +15,13 @@ from auth.permissions import (ReadRepositoryPermission, ModifyRepositoryPermissi
|
|||
AdministerRepositoryPermission)
|
||||
from data import model
|
||||
from util.http import abort
|
||||
|
||||
from util.saas.metricqueue import time_blueprint
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
v2_bp = Blueprint('v2', __name__)
|
||||
|
||||
time_blueprint(v2_bp, metric_queue)
|
||||
|
||||
def _require_repo_permission(permission_class, allow_public=False):
|
||||
def wrapper(func):
|
||||
|
|
Reference in a new issue