-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
feat(executor): Add user agent to workflow executor #5014
Conversation
Signed-off-by: terrytangyuan <[email protected]>
cmd/argoexec/commands/root.go
Outdated
@@ -72,6 +74,7 @@ func NewRootCommand() *cobra.Command { | |||
func initExecutor() *executor.WorkflowExecutor { | |||
log.WithField("version", argo.GetVersion().Version).Info("Starting Workflow Executor") | |||
config, err := clientConfig.ClientConfig() | |||
config = restclient.AddUserAgent(config, fmt.Sprintf("argo-workflow-%s-executor", os.Getenv(common.EnvVarContainerRuntimeExecutor))) |
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.
user agent should probably be something like
User-Agent: <product> / <product-version> <comment>
E.g.
argo-workflows/v3.0.0 executor/docker
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent
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.
Thanks! Just updated the UA to follow the convention.
Signed-off-by: terrytangyuan <[email protected]>
config, err := clientConfig.ClientConfig() | ||
config = restclient.AddUserAgent(config, fmt.Sprintf("argo-workflow-%s-executor", os.Getenv(common.EnvVarContainerRuntimeExecutor))) | ||
executorType := os.Getenv(common.EnvVarContainerRuntimeExecutor) | ||
config = restclient.AddUserAgent(config, fmt.Sprintf("argo-workflows/%s executor/%s", version.Version, executorType)) |
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.
@jessesuen thoughts on this User-Agent?
Awaiting feedback from @jessesuen. |
Seems like it would be beneficial without any risk. |
We have many different applications calling apiserver and setting the user agent would allow us to distinguish the API calls among those applications for further traffic control/monitoring. This would also prepare us to try different executors in #4998 and monitor their relevant traffic.
Signed-off-by: terrytangyuan [email protected]
Checklist: