-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
track http service error count #15523
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
Conversation
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of a noob question – I'm not super familiar with FastAPI – but would it be cleaner to track 4xx/5xx responses via some custom middleware (e.g., app.add_middleware(ResponseCodeMiddleware))? That way, it's easier to reason about the code and make sure we don't miss a spot where the counter should be incremented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea you're right, middleware is the cleanest way to handle this - however we've previously found when developing load_aware_call that the middleware approach negatively impacts performance. When running the benchmark with the decorator instead we don't see the same performance hit
e5c82c4 to
f7e5749
Compare
| "If set to True, enable tracking server_load_metrics in the app state." | ||
| ) | ||
| parser.add_argument( | ||
| "--enable-http-middleware", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I view http-middleware decorator as a code structure extension instead of feature extension. No need to have a explicit control for this?
The feature we could control is the counter/logging, but I feel it's pretty standard and we should just enable it for all use cases? cc: @simon-mo
f7e5749 to
65ff126
Compare
65ff126 to
b686de2
Compare
|
cc @markmc |
prometheus_fastapi_instrumentator seems more popular and is already included in the common vllm requirements I went ahead and implemented it here: |
Track error count at the http service level in the app state.
Register as aggregated_error_count in the prometheus metrics