Skip to content
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

Override SDK-set headers for client name and others #450

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

cretz
Copy link
Member

@cretz cretz commented Feb 13, 2024

What was changed

Add client-name, client-version, supported-server-versions, and caller-type headers on outbound client calls in CLI refresh code. Previous CLI used outgoing gRPC metadata on the context, but my research has shown we overwrite that anyways. So up until now we may not have been setting these headers properly (making CLI appear as Go SDK).

Checklist

  1. Closes CLI Refresh: Need client-name and client-version headers as CLI with version #440

@cretz cretz requested a review from a team February 13, 2024 22:57
md.Set("client-name", "temporal-cli")
md.Set("client-version", Version)
md.Set("supported-server-versions", ">=1.0.0 <2.0.0")
md.Set("caller-type", "operator")
Copy link
Member

Choose a reason for hiding this comment

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

What is this one for?

Copy link
Member

Choose a reason for hiding this comment

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

It gives calls made by the CLI higher priority over application code.
This helps troubleshoot issues when you're getting rate limited for example.

@cretz cretz merged commit 8c0cfeb into cli-rewrite Feb 14, 2024
5 checks passed
@cretz cretz deleted the client-headers branch February 14, 2024 13:33
)

// Capture from server
// TODO(cretz): Pending fix on server for gRPC interceptors
Copy link
Member Author

@cretz cretz Feb 14, 2024

Choose a reason for hiding this comment

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

temporalio/temporal#5414 is the fix for those curious (added after this code was written, so not in the comment)

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