Skip to content

Commit f73d351

Browse files
Add Stats to DescribeWorkerDeploymentVersion (#603)
_**READ BEFORE MERGING:** All PRs require approval by both Server AND SDK teams before merging! This is why the number of required approvals is "2" and not "1"--two reviewers from the same team is NOT sufficient. If your PR is not approved by someone in BOTH teams, it may be summarily reverted._ <!-- Describe what has changed in this PR --> **What changed?** (1) Deprecated `task_queue_infos` in `deployment.WorkerDeploymentVersionInfo`. (2) Added `version_task_queues` to `DescribeWorkerDeploymentVersionResponse`. <!-- Tell your future self why have you made these changes --> **Why?** We want to report task queue stats for each task queue that is part of a worker deployment version. The challenge is that the `taskqueue` package depends on the `deployment` package. So adding `TaskQueueStats` to `deployment.WorkerDeploymentVersionInfo` causes a cycle import error. Weighing our options, we decided to effectively _move_ the task queue-related data from within the deployment package into the response message. <!-- Are there any breaking changes on binary or code level? --> **Breaking changes** Not yet; but in subsequent releases the deprecated field `task_queue_infos` will be removed. <!-- If this breaks the Server, please provide the Server PR to merge right after this PR was merged. --> **Server PR** temporalio/temporal#7959 (draft) --------- Co-authored-by: Spencer Judge <[email protected]>
1 parent 486e456 commit f73d351

File tree

4 files changed

+86
-2
lines changed

4 files changed

+86
-2
lines changed

openapi/openapiv2.json

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1777,6 +1777,13 @@
17771777
"in": "query",
17781778
"required": false,
17791779
"type": "string"
1780+
},
1781+
{
1782+
"name": "reportTaskQueueStats",
1783+
"description": "Report stats for task queues which have been polled by this version.",
1784+
"in": "query",
1785+
"required": false,
1786+
"type": "boolean"
17801787
}
17811788
],
17821789
"tags": [
@@ -5378,6 +5385,13 @@
53785385
"in": "query",
53795386
"required": false,
53805387
"type": "string"
5388+
},
5389+
{
5390+
"name": "reportTaskQueueStats",
5391+
"description": "Report stats for task queues which have been polled by this version.",
5392+
"in": "query",
5393+
"required": false,
5394+
"type": "boolean"
53815395
}
53825396
],
53835397
"tags": [
@@ -6918,6 +6932,21 @@
69186932
}
69196933
}
69206934
},
6935+
"DescribeWorkerDeploymentVersionResponseVersionTaskQueue": {
6936+
"type": "object",
6937+
"properties": {
6938+
"name": {
6939+
"type": "string"
6940+
},
6941+
"type": {
6942+
"$ref": "#/definitions/v1TaskQueueType"
6943+
},
6944+
"stats": {
6945+
"$ref": "#/definitions/v1TaskQueueStats",
6946+
"description": "Only set if `report_task_queue_stats` is set on the request."
6947+
}
6948+
}
6949+
},
69216950
"EndpointTargetExternal": {
69226951
"type": "object",
69236952
"properties": {
@@ -10326,6 +10355,14 @@
1032610355
"properties": {
1032710356
"workerDeploymentVersionInfo": {
1032810357
"$ref": "#/definitions/v1WorkerDeploymentVersionInfo"
10358+
},
10359+
"versionTaskQueues": {
10360+
"type": "array",
10361+
"items": {
10362+
"type": "object",
10363+
"$ref": "#/definitions/DescribeWorkerDeploymentVersionResponseVersionTaskQueue"
10364+
},
10365+
"description": "All the Task Queues that have ever polled from this Deployment version."
1032910366
}
1033010367
}
1033110368
},
@@ -15252,7 +15289,7 @@
1525215289
"type": "object",
1525315290
"$ref": "#/definitions/WorkerDeploymentVersionInfoVersionTaskQueueInfo"
1525415291
},
15255-
"description": "All the Task Queues that have ever polled from this Deployment version."
15292+
"description": "All the Task Queues that have ever polled from this Deployment version.\nDeprecated. Use `version_task_queues` in DescribeWorkerDeploymentVersionResponse instead."
1525615293
},
1525715294
"drainageInfo": {
1525815295
"$ref": "#/definitions/v1VersionDrainageInfo",

openapi/openapiv3.yaml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,6 +1590,11 @@ paths:
15901590
description: Identifies the Worker Deployment this Version is part of.
15911591
schema:
15921592
type: string
1593+
- name: reportTaskQueueStats
1594+
in: query
1595+
description: Report stats for task queues which have been polled by this version.
1596+
schema:
1597+
type: boolean
15931598
responses:
15941599
"200":
15951600
description: OK
@@ -4823,6 +4828,11 @@ paths:
48234828
description: Identifies the Worker Deployment this Version is part of.
48244829
schema:
48254830
type: string
4831+
- name: reportTaskQueueStats
4832+
in: query
4833+
description: Report stats for task queues which have been polled by this version.
4834+
schema:
4835+
type: boolean
48264836
responses:
48274837
"200":
48284838
description: OK
@@ -7536,6 +7546,28 @@ components:
75367546
properties:
75377547
workerDeploymentVersionInfo:
75387548
$ref: '#/components/schemas/WorkerDeploymentVersionInfo'
7549+
versionTaskQueues:
7550+
type: array
7551+
items:
7552+
$ref: '#/components/schemas/DescribeWorkerDeploymentVersionResponse_VersionTaskQueue'
7553+
description: All the Task Queues that have ever polled from this Deployment version.
7554+
DescribeWorkerDeploymentVersionResponse_VersionTaskQueue:
7555+
type: object
7556+
properties:
7557+
name:
7558+
type: string
7559+
type:
7560+
enum:
7561+
- TASK_QUEUE_TYPE_UNSPECIFIED
7562+
- TASK_QUEUE_TYPE_WORKFLOW
7563+
- TASK_QUEUE_TYPE_ACTIVITY
7564+
- TASK_QUEUE_TYPE_NEXUS
7565+
type: string
7566+
format: enum
7567+
stats:
7568+
allOf:
7569+
- $ref: '#/components/schemas/TaskQueueStats'
7570+
description: Only set if `report_task_queue_stats` is set on the request.
75397571
DescribeWorkflowExecutionResponse:
75407572
type: object
75417573
properties:
@@ -12637,7 +12669,9 @@ components:
1263712669
type: array
1263812670
items:
1263912671
$ref: '#/components/schemas/WorkerDeploymentVersionInfo_VersionTaskQueueInfo'
12640-
description: All the Task Queues that have ever polled from this Deployment version.
12672+
description: |-
12673+
All the Task Queues that have ever polled from this Deployment version.
12674+
Deprecated. Use `version_task_queues` in DescribeWorkerDeploymentVersionResponse instead.
1264112675
drainageInfo:
1264212676
allOf:
1264312677
- $ref: '#/components/schemas/VersionDrainageInfo'

temporal/api/deployment/v1/message.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ message WorkerDeploymentVersionInfo {
128128
float ramp_percentage = 7;
129129

130130
// All the Task Queues that have ever polled from this Deployment version.
131+
// Deprecated. Use `version_task_queues` in DescribeWorkerDeploymentVersionResponse instead.
131132
repeated VersionTaskQueueInfo task_queue_infos = 8;
132133
message VersionTaskQueueInfo {
133134
string name = 1;

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,10 +2026,22 @@ message DescribeWorkerDeploymentVersionRequest {
20262026
string version = 2 [deprecated = true];
20272027
// Required.
20282028
temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 3;
2029+
// Report stats for task queues which have been polled by this version.
2030+
bool report_task_queue_stats = 4;
20292031
}
20302032

20312033
message DescribeWorkerDeploymentVersionResponse {
20322034
temporal.api.deployment.v1.WorkerDeploymentVersionInfo worker_deployment_version_info = 1;
2035+
2036+
// All the Task Queues that have ever polled from this Deployment version.
2037+
repeated VersionTaskQueue version_task_queues = 2;
2038+
// (-- api-linter: core::0123::resource-annotation=disabled --)
2039+
message VersionTaskQueue {
2040+
string name = 1;
2041+
temporal.api.enums.v1.TaskQueueType type = 2;
2042+
// Only set if `report_task_queue_stats` is set on the request.
2043+
temporal.api.taskqueue.v1.TaskQueueStats stats = 3;
2044+
}
20332045
}
20342046

20352047
message DescribeWorkerDeploymentRequest {

0 commit comments

Comments
 (0)