New taskNames query param on the task stats endpoint for KEDA friendliness#3791
New taskNames query param on the task stats endpoint for KEDA friendliness#3791
taskNames query param on the task stats endpoint for KEDA friendliness#3791Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Promptless prepared a documentation update related to this change. Triggered by PR #3791 Your PR updates the KEDA examples with the new Review: Document taskNames parameter |
There was a problem hiding this comment.
Pull request overview
Adds a taskNames query parameter to the tenant task-stats endpoint so callers (notably KEDA’s metrics-api scaler) can request specific task keys to always be present in the JSON response (zero-filled when missing), avoiding {} responses that break JSONPath resolution.
Changes:
- Extend the OpenAPI contract + generated server/client code to accept
taskNames[]onGET /api/v1/tenants/{tenant}/task-stats. - Update the tenant task-stats handler/transformer to normalize requested names and zero-fill missing tasks.
- Update autoscaling docs to include
taskNamesusage in KEDA examples.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/client/rest/gen.go | Updates generated Go REST client method signature and request builder to send taskNames query params. |
| api-contracts/openapi/paths/tenant/tenant.yaml | Adds taskNames array query parameter to the task-stats endpoint contract. |
| api/v1/server/oas/gen/openapi.gen.go | Updates generated server interface/wrapper binding to parse taskNames from the query string. |
| api/v1/server/handlers/tenants/get_task_stats.go | Normalizes taskNames from request params and passes them into the transformer. |
| api/v1/server/oas/transformers/tenant.go | Extends ToTaskStats to add zero-filled stats for required task names. |
| frontend/app/src/lib/api/generated/Api.ts | Updates generated frontend API method to accept optional taskNames query input. |
| frontend/docs/pages/v1/autoscaling-workers.mdx | Updates KEDA configuration examples and explains why taskNames is needed. |
Description
KEDA's metrics API requires non-nil and non-empty JSON response. This PR adds a new
taskNamesstring slice param to the task stats endpoint which can return zero responses for KEDA friendliness.Type of change