Skip to content

[WiP] Deployment and TaskQueue Stats API #571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
268 changes: 268 additions & 0 deletions openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -1610,6 +1610,75 @@
]
}
},
"/api/v1/namespaces/{namespace}/task-queues/{taskQueue.name}/type/{taskQueueType}/get-stats": {
"post": {
"summary": "GetTaskQueueStats returns stats for a single task queue.",
"operationId": "GetTaskQueueStats2",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1GetTaskQueueStatsResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "taskQueue.name",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "taskQueueType",
"in": "path",
"required": true,
"type": "string",
"enum": [
"TASK_QUEUE_TYPE_UNSPECIFIED",
"TASK_QUEUE_TYPE_WORKFLOW",
"TASK_QUEUE_TYPE_ACTIVITY",
"TASK_QUEUE_TYPE_NEXUS"
]
},
{
"name": "taskQueue.kind",
"description": "Default: TASK_QUEUE_KIND_NORMAL.\n\n - TASK_QUEUE_KIND_NORMAL: Tasks from a normal workflow task queue always include complete workflow history\n\nThe task queue specified by the user is always a normal task queue. There can be as many\nworkers as desired for a single normal task queue. All those workers may pick up tasks from\nthat queue.\n - TASK_QUEUE_KIND_STICKY: A sticky queue only includes new history since the last workflow task, and they are\nper-worker.\n\nSticky queues are created dynamically by each worker during their start up. They only exist\nfor the lifetime of the worker process. Tasks in a sticky task queue are only available to\nthe worker that created the sticky queue.\n\nSticky queues are only for workflow tasks. There are no sticky task queues for activities.",
"in": "query",
"required": false,
"type": "string",
"enum": [
"TASK_QUEUE_KIND_UNSPECIFIED",
"TASK_QUEUE_KIND_NORMAL",
"TASK_QUEUE_KIND_STICKY"
],
"default": "TASK_QUEUE_KIND_UNSPECIFIED"
},
{
"name": "taskQueue.normalName",
"description": "Iff kind == TASK_QUEUE_KIND_STICKY, then this field contains the name of\nthe normal task queue that the sticky worker is running on.",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/api/v1/namespaces/{namespace}/task-queues/{taskQueue}/worker-build-id-compatibility": {
"get": {
"summary": "Deprecated. Use `GetWorkerVersioningRules`.\nFetches the worker build id versioning sets for a task queue.",
Expand Down Expand Up @@ -2080,6 +2149,51 @@
]
}
},
"/api/v1/namespaces/{namespace}/worker-deployments/{deploymentName}/{deploymentVersion}/stats": {
"get": {
"summary": "GetWorkerDeploymentStats returns the stats for all task queues in a deployment version.",
"operationId": "GetWorkerDeploymentStats2",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1GetWorkerDeploymentStatsResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "deploymentName",
"description": "Name of the deployment to return stats for.\n",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "deploymentVersion",
"description": "Optional. Deployment version to return stats for.\nIf left empty, the current version will be queried.",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/api/v1/namespaces/{namespace}/worker-task-reachability": {
"get": {
"summary": "Deprecated. Use `DescribeTaskQueue`.",
Expand Down Expand Up @@ -5123,6 +5237,75 @@
]
}
},
"/namespaces/{namespace}/task-queues/{taskQueue.name}/type/{taskQueueType}/get-stats": {
"post": {
"summary": "GetTaskQueueStats returns stats for a single task queue.",
"operationId": "GetTaskQueueStats",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1GetTaskQueueStatsResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "taskQueue.name",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "taskQueueType",
"in": "path",
"required": true,
"type": "string",
"enum": [
"TASK_QUEUE_TYPE_UNSPECIFIED",
"TASK_QUEUE_TYPE_WORKFLOW",
"TASK_QUEUE_TYPE_ACTIVITY",
"TASK_QUEUE_TYPE_NEXUS"
]
},
{
"name": "taskQueue.kind",
"description": "Default: TASK_QUEUE_KIND_NORMAL.\n\n - TASK_QUEUE_KIND_NORMAL: Tasks from a normal workflow task queue always include complete workflow history\n\nThe task queue specified by the user is always a normal task queue. There can be as many\nworkers as desired for a single normal task queue. All those workers may pick up tasks from\nthat queue.\n - TASK_QUEUE_KIND_STICKY: A sticky queue only includes new history since the last workflow task, and they are\nper-worker.\n\nSticky queues are created dynamically by each worker during their start up. They only exist\nfor the lifetime of the worker process. Tasks in a sticky task queue are only available to\nthe worker that created the sticky queue.\n\nSticky queues are only for workflow tasks. There are no sticky task queues for activities.",
"in": "query",
"required": false,
"type": "string",
"enum": [
"TASK_QUEUE_KIND_UNSPECIFIED",
"TASK_QUEUE_KIND_NORMAL",
"TASK_QUEUE_KIND_STICKY"
],
"default": "TASK_QUEUE_KIND_UNSPECIFIED"
},
{
"name": "taskQueue.normalName",
"description": "Iff kind == TASK_QUEUE_KIND_STICKY, then this field contains the name of\nthe normal task queue that the sticky worker is running on.",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/namespaces/{namespace}/task-queues/{taskQueue}/worker-build-id-compatibility": {
"get": {
"summary": "Deprecated. Use `GetWorkerVersioningRules`.\nFetches the worker build id versioning sets for a task queue.",
Expand Down Expand Up @@ -5554,6 +5737,51 @@
]
}
},
"/namespaces/{namespace}/worker-deployments/{deploymentName}/{deploymentVersion}/stats": {
"get": {
"summary": "GetWorkerDeploymentStats returns the stats for all task queues in a deployment version.",
"operationId": "GetWorkerDeploymentStats",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1GetWorkerDeploymentStatsResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "deploymentName",
"description": "Name of the deployment to return stats for.\n",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "deploymentVersion",
"description": "Optional. Deployment version to return stats for.\nIf left empty, the current version will be queried.",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/namespaces/{namespace}/worker-task-reachability": {
"get": {
"summary": "Deprecated. Use `DescribeTaskQueue`.",
Expand Down Expand Up @@ -10306,6 +10534,14 @@
},
"description": "System capability details."
},
"v1GetTaskQueueStatsResponse": {
"type": "object",
"properties": {
"taskQueueStats": {
"$ref": "#/definitions/v1TaskQueueStats"
}
}
},
"v1GetWorkerBuildIdCompatibilityResponse": {
"type": "object",
"properties": {
Expand All @@ -10320,6 +10556,24 @@
},
"title": "[cleanup-wv-pre-release]"
},
"v1GetWorkerDeploymentStatsResponse": {
"type": "object",
"properties": {
"perQueueMetrics": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/v1TaskQueueStatsInfo"
},
"title": "Collection of stats for all task queues in the requested deployment.\nNote that the data is"
},
"approximateTotalBacklogCount": {
"type": "string",
"format": "int64",
"title": "The sum of backlog counts across all task queues in the deployment.\nNote that same as the task queue metrics, this value is"
}
}
},
"v1GetWorkerTaskReachabilityResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -13984,6 +14238,20 @@
},
"description": "TaskQueueStats contains statistics about task queue backlog and activity.\n\nFor workflow task queue type, this result is partial because tasks sent to sticky queues are not included. Read\ncomments above each metric to understand the impact of sticky queue exclusion on that metric accuracy."
},
"v1TaskQueueStatsInfo": {
"type": "object",
"properties": {
"taskQueue": {
"$ref": "#/definitions/v1TaskQueue"
},
"taskQueueType": {
"$ref": "#/definitions/v1TaskQueueType"
},
"taskQueueStats": {
"$ref": "#/definitions/v1TaskQueueStats"
}
}
},
"v1TaskQueueStatus": {
"type": "object",
"properties": {
Expand Down
Loading
Loading