Skip to content

New taskNames query param on the task stats endpoint for KEDA friendliness#3791

Open
mnafees wants to merge 2 commits intomainfrom
nafees/task-stats-keda
Open

New taskNames query param on the task stats endpoint for KEDA friendliness#3791
mnafees wants to merge 2 commits intomainfrom
nafees/task-stats-keda

Conversation

@mnafees
Copy link
Copy Markdown
Member

@mnafees mnafees commented Apr 30, 2026

Description

KEDA's metrics API requires non-nil and non-empty JSON response. This PR adds a new taskNames string slice param to the task stats endpoint which can return zero responses for KEDA friendliness.

Type of change

  • Documentation change (pure documentation change)
  • New feature (non-breaking change which adds functionality)

@mnafees mnafees requested a review from mrkaye97 April 30, 2026 10:51
@mnafees mnafees self-assigned this Apr 30, 2026
Copilot AI review requested due to automatic review settings April 30, 2026 10:51
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hatchet-docs Ready Ready Preview, Comment Apr 30, 2026 11:54am

Request Review

@promptless-for-oss
Copy link
Copy Markdown

Promptless prepared a documentation update related to this change.

Triggered by PR #3791

Your PR updates the KEDA examples with the new taskNames parameter but doesn't document it in the formal API reference section. I've added a Query Parameters table to the Task Stats API section so users can find all available parameters in one place.

Review: Document taskNames parameter

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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[] on GET /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 taskNames usage 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.

Comment thread api/v1/server/oas/transformers/tenant.go Outdated
Comment thread api/v1/server/handlers/tenants/get_task_stats.go
Comment thread pkg/client/rest/gen.go
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.

3 participants