-
Notifications
You must be signed in to change notification settings - Fork 69
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
base: master
Are you sure you want to change the base?
Conversation
repeated temporal.api.taskqueue.v1.TaskQueueStatDetails per_queue_stats = 1; | ||
|
||
// Aggregated backlog count across all task queues in this deployment version. | ||
int64 approximate_total_backlog_count = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name is derived from TaskQueueStatDetails
's approximate_backlog_count
field.
6b25fed
to
fa2df53
Compare
f46f542
to
9778bd9
Compare
|
||
// Optional. Deployment version to return stats for. | ||
// If left empty, the current version will be queried. | ||
string deployment_version = 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to double-check that build_id
isn't a better field name here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're in the middle of that discussion right now in the Versioning crew, we have not fully converged yet. If you want to merge this asap, I think build_id
is the safer alternative.
message TaskQueueStatsInfo { | ||
temporal.api.taskqueue.v1.TaskQueue task_queue = 1; | ||
temporal.api.enums.v1.TaskQueueType task_queue_type = 2; | ||
temporal.api.taskqueue.v1.TaskQueueStats task_queue_stats = 3; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message only exists because TaskQueueStats
doesn't contain the task queue name and task_queue_type.
I considered adding them to the existing TaskQueueStats
, but was discouraged to do so.
ba4700d
to
2c3d3cf
Compare
// GetWorkerDeploymentStats returns the stats for all task queues in a deployment version. | ||
rpc GetWorkerDeploymentStats (GetWorkerDeploymentStatsRequest) returns (GetWorkerDeploymentStatsResponse) { | ||
option (google.api.http) = { | ||
get: "/namespaces/{namespace}/worker-deployments/{deployment_name}/{deployment_version}/stats" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since deployment_version
can be empty, I'm not sure this is right yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should only put the name in the url.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shows I'm not familiar with how the grpc-http bridge works. I suppose the other args are passed as query parameters?
// GetTaskQueueStats returns stats for a single task queue. | ||
rpc GetTaskQueueStats (GetTaskQueueStatsRequest) returns (GetTaskQueueStatsResponse) { | ||
option (google.api.http) = { | ||
post: "/namespaces/{namespace}/task-queues/{task_queue.name}/type/{task_queue_type}/get-stats" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work with the task_queue_type
enum in there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot says we can and caller would put the numeric values of the enum in the URL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I don't know if the numeric enum representation is a good choice here.
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.
What changed?
Added two new APIs:
GetWorkerDeploymentStats
GetTaskQueueStats
Why?
To return task queue stats to users for making scaling decisions.
Breaking changes
No.
Server PR
temporalio/temporal#7581 (feature complete, but not yet production-ready)