Skip to content

Commit

Permalink
Add logging to confidant ingress (#390)
Browse files Browse the repository at this point in the history
Ingress sometimes is being affected by 4xx's, this will add more
observability for when this issue happens.

---------

Co-authored-by: Dean Liu <[email protected]>
  • Loading branch information
alejandroroiz and skiptomyliu authored Jul 5, 2023
1 parent cd54667 commit 85a6676
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions confidant/routes/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ def get_service(id):
id
)
error_msg = {'error': msg, 'reference': id}
logger.warning(msg)
return jsonify(error_msg), 403

logger.info(
Expand All @@ -277,9 +278,14 @@ def get_service(id):
msg = 'Authenticated user is not authorized.'
return jsonify({'error': msg}), 401
except DoesNotExist:
logger.warning('Item with id {0} does not exist.'.format(id))
return jsonify({}), 404
except Exception as e:
logger.warning('Exception occurred: {0}'.format(e))
raise e
if (service.data_type != 'service' and
service.data_type != 'archive-service'):
logger.warning('Item with id {0} is not a service.'.format(id))
return jsonify({}), 404
logger.debug('Authz succeeded for service {0}.'.format(id))
try:
Expand Down

0 comments on commit 85a6676

Please sign in to comment.