Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out healthcheck endpoints from access logging #210

Merged
merged 2 commits into from
Feb 8, 2023

Conversation

zero1zero
Copy link
Contributor

@zero1zero zero1zero commented Feb 7, 2023

What

We don't want to display access logging by default for healthcheck endpoints

How

Adding a logging filter for the uvicorn.access logger to filter out by endpoint

# for any health check endpoints, lets skip logging
return (
record.getMessage().find("/") == -1
and record.getMessage().find("/v1/models/model") == -1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to move the healthcheck endpoints to constants somewhere. I feel this /v1/models/model is too verbose and we may want to change this in future, so would be good to have it consolidated as constant.

@pankajroark pankajroark self-requested a review February 8, 2023 00:44
Copy link
Collaborator

@pankajroark pankajroark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @jrochette 's comment is worth double checking on. Otherwise, lgtm.

@zero1zero zero1zero merged commit 40a339e into main Feb 8, 2023
@zero1zero zero1zero deleted the zack-filter-access-logging branch February 8, 2023 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants