feat: add job monitoring endpoint /backends/jobs #8095
+165
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses issue #7906 by implementing a job tracking system. It allows users to monitor running AI jobs (like chat completions, transcriptions, etc.) via a new API endpoint.
Changes
core/http/jobs: Implemented a thread-safe in-memory store to track job status, start time, and metadata.JobTrackerMiddlewarewhich intercepts/v1/and/api/requests to automatically register them in the job store.GET /backends/jobswhich returns the list of active and recently finished jobs.Related Issue
Fixes #7906
Testing
curlby sending a POST request to/v1/chat/completions./backends/jobsreturns the job details with statusexecuting(during processing) andfinishedorerror(after completion).Sample Output:
[ { "job_id": "4cb9b834-d190-47dc-87b3-b8cfb70f6ab0", "type": "/v1/chat/completions", "model": "gpt-4", "start_time": "2026-01-18T17:09:18.72755107Z", "status": "executing", "client_ip": "4.240.39.193" } ]