From 5aa534195227d2cd00457b4375568d1a91445e56 Mon Sep 17 00:00:00 2001 From: Stephan Behnke Date: Fri, 20 Jun 2025 12:27:58 -0700 Subject: [PATCH 1/4] Add Stats to DescribeWorkerDeploymentVersion --- openapi/openapiv2.json | 24 ++++++++++++++++++- openapi/openapiv3.yaml | 24 ++++++++++++++++++- temporal/api/deployment/v1/message.proto | 1 + .../workflowservice/v1/request_response.proto | 9 +++++++ 4 files changed, 56 insertions(+), 2 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index d5a0e4b9d..57fde124f 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -6918,6 +6918,20 @@ } } }, + "DescribeWorkerDeploymentVersionResponseVersionTaskQueue": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/v1TaskQueueType" + }, + "stats": { + "$ref": "#/definitions/v1TaskQueueStats" + } + } + }, "EndpointTargetExternal": { "type": "object", "properties": { @@ -10326,6 +10340,14 @@ "properties": { "workerDeploymentVersionInfo": { "$ref": "#/definitions/v1WorkerDeploymentVersionInfo" + }, + "versionTaskQueues": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/DescribeWorkerDeploymentVersionResponseVersionTaskQueue" + }, + "description": "All the Task Queues that have ever polled from this Deployment version." } } }, @@ -15252,7 +15274,7 @@ "type": "object", "$ref": "#/definitions/WorkerDeploymentVersionInfoVersionTaskQueueInfo" }, - "description": "All the Task Queues that have ever polled from this Deployment version." + "description": "All the Task Queues that have ever polled from this Deployment version.\nDeprecated. Use `version_task_queues` in DescribeWorkerDeploymentVersionResponse instead." }, "drainageInfo": { "$ref": "#/definitions/v1VersionDrainageInfo", diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 3ce7e9e3b..47691bd7f 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -7536,6 +7536,26 @@ components: properties: workerDeploymentVersionInfo: $ref: '#/components/schemas/WorkerDeploymentVersionInfo' + versionTaskQueues: + type: array + items: + $ref: '#/components/schemas/DescribeWorkerDeploymentVersionResponse_VersionTaskQueue' + description: All the Task Queues that have ever polled from this Deployment version. + DescribeWorkerDeploymentVersionResponse_VersionTaskQueue: + type: object + properties: + name: + type: string + type: + enum: + - TASK_QUEUE_TYPE_UNSPECIFIED + - TASK_QUEUE_TYPE_WORKFLOW + - TASK_QUEUE_TYPE_ACTIVITY + - TASK_QUEUE_TYPE_NEXUS + type: string + format: enum + stats: + $ref: '#/components/schemas/TaskQueueStats' DescribeWorkflowExecutionResponse: type: object properties: @@ -12637,7 +12657,9 @@ components: type: array items: $ref: '#/components/schemas/WorkerDeploymentVersionInfo_VersionTaskQueueInfo' - description: All the Task Queues that have ever polled from this Deployment version. + description: |- + All the Task Queues that have ever polled from this Deployment version. + Deprecated. Use `version_task_queues` in DescribeWorkerDeploymentVersionResponse instead. drainageInfo: allOf: - $ref: '#/components/schemas/VersionDrainageInfo' diff --git a/temporal/api/deployment/v1/message.proto b/temporal/api/deployment/v1/message.proto index b35d7ec9e..14b4205c5 100644 --- a/temporal/api/deployment/v1/message.proto +++ b/temporal/api/deployment/v1/message.proto @@ -128,6 +128,7 @@ message WorkerDeploymentVersionInfo { float ramp_percentage = 7; // All the Task Queues that have ever polled from this Deployment version. + // Deprecated. Use `version_task_queues` in DescribeWorkerDeploymentVersionResponse instead. repeated VersionTaskQueueInfo task_queue_infos = 8; message VersionTaskQueueInfo { string name = 1; diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 6b413ed8d..83cc0ffde 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2030,6 +2030,15 @@ message DescribeWorkerDeploymentVersionRequest { message DescribeWorkerDeploymentVersionResponse { temporal.api.deployment.v1.WorkerDeploymentVersionInfo worker_deployment_version_info = 1; + + // All the Task Queues that have ever polled from this Deployment version. + repeated VersionTaskQueue version_task_queues = 2; + // (-- api-linter: core::0123::resource-annotation=disabled --) + message VersionTaskQueue { + string name = 1; + temporal.api.enums.v1.TaskQueueType type = 2; + temporal.api.taskqueue.v1.TaskQueueStats stats = 3; + } } message DescribeWorkerDeploymentRequest { From 94bd8a9b21c03c87742562e20f67a51875942599 Mon Sep 17 00:00:00 2001 From: Stephan Behnke Date: Tue, 24 Jun 2025 16:24:35 -0700 Subject: [PATCH 2/4] Add `report_task_queue_stats`. --- openapi/openapiv2.json | 17 ++++++++++++++++- openapi/openapiv3.yaml | 14 +++++++++++++- .../workflowservice/v1/request_response.proto | 3 +++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 57fde124f..5de8e8a09 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -1777,6 +1777,13 @@ "in": "query", "required": false, "type": "string" + }, + { + "name": "reportTaskQueueStats", + "description": "Report stats for version's task queues.", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ @@ -5378,6 +5385,13 @@ "in": "query", "required": false, "type": "string" + }, + { + "name": "reportTaskQueueStats", + "description": "Report stats for version's task queues.", + "in": "query", + "required": false, + "type": "boolean" } ], "tags": [ @@ -6928,7 +6942,8 @@ "$ref": "#/definitions/v1TaskQueueType" }, "stats": { - "$ref": "#/definitions/v1TaskQueueStats" + "$ref": "#/definitions/v1TaskQueueStats", + "description": "Only set if `report_task_queue_stats` is set on the request." } } }, diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index 47691bd7f..d1fe7d931 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -1590,6 +1590,11 @@ paths: description: Identifies the Worker Deployment this Version is part of. schema: type: string + - name: reportTaskQueueStats + in: query + description: Report stats for version's task queues. + schema: + type: boolean responses: "200": description: OK @@ -4823,6 +4828,11 @@ paths: description: Identifies the Worker Deployment this Version is part of. schema: type: string + - name: reportTaskQueueStats + in: query + description: Report stats for version's task queues. + schema: + type: boolean responses: "200": description: OK @@ -7555,7 +7565,9 @@ components: type: string format: enum stats: - $ref: '#/components/schemas/TaskQueueStats' + allOf: + - $ref: '#/components/schemas/TaskQueueStats' + description: Only set if `report_task_queue_stats` is set on the request. DescribeWorkflowExecutionResponse: type: object properties: diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index 83cc0ffde..bfcf74cd6 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2026,6 +2026,8 @@ message DescribeWorkerDeploymentVersionRequest { string version = 2 [deprecated = true]; // Required. temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 3; + // Report stats for version's task queues. + bool report_task_queue_stats = 4; } message DescribeWorkerDeploymentVersionResponse { @@ -2037,6 +2039,7 @@ message DescribeWorkerDeploymentVersionResponse { message VersionTaskQueue { string name = 1; temporal.api.enums.v1.TaskQueueType type = 2; + // Only set if `report_task_queue_stats` is set on the request. temporal.api.taskqueue.v1.TaskQueueStats stats = 3; } } From ac386cb3969e4c187034df98a8c0eaafdcd4962e Mon Sep 17 00:00:00 2001 From: Stephan Behnke Date: Thu, 26 Jun 2025 11:13:09 -0700 Subject: [PATCH 3/4] expand comment Co-authored-by: Spencer Judge --- temporal/api/workflowservice/v1/request_response.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/temporal/api/workflowservice/v1/request_response.proto b/temporal/api/workflowservice/v1/request_response.proto index bfcf74cd6..718ddc666 100644 --- a/temporal/api/workflowservice/v1/request_response.proto +++ b/temporal/api/workflowservice/v1/request_response.proto @@ -2026,7 +2026,7 @@ message DescribeWorkerDeploymentVersionRequest { string version = 2 [deprecated = true]; // Required. temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 3; - // Report stats for version's task queues. + // Report stats for task queues which have been polled by this version. bool report_task_queue_stats = 4; } From 07ac29e0f43313c288bd4e474f86c0bb00493a84 Mon Sep 17 00:00:00 2001 From: Stephan Behnke Date: Thu, 26 Jun 2025 11:18:51 -0700 Subject: [PATCH 4/4] update docs --- openapi/openapiv2.json | 4 ++-- openapi/openapiv3.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 5de8e8a09..0a169fbc6 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -1780,7 +1780,7 @@ }, { "name": "reportTaskQueueStats", - "description": "Report stats for version's task queues.", + "description": "Report stats for task queues which have been polled by this version.", "in": "query", "required": false, "type": "boolean" @@ -5388,7 +5388,7 @@ }, { "name": "reportTaskQueueStats", - "description": "Report stats for version's task queues.", + "description": "Report stats for task queues which have been polled by this version.", "in": "query", "required": false, "type": "boolean" diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index d1fe7d931..6bb75b4f0 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -1592,7 +1592,7 @@ paths: type: string - name: reportTaskQueueStats in: query - description: Report stats for version's task queues. + description: Report stats for task queues which have been polled by this version. schema: type: boolean responses: @@ -4830,7 +4830,7 @@ paths: type: string - name: reportTaskQueueStats in: query - description: Report stats for version's task queues. + description: Report stats for task queues which have been polled by this version. schema: type: boolean responses: