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

feat(executor): Add user agent to workflow executor #5014

Merged
merged 3 commits into from
Feb 10, 2021
Merged

feat(executor): Add user agent to workflow executor #5014

merged 3 commits into from
Feb 10, 2021

Conversation

terrytangyuan
Copy link
Member

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:

@@ -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)))
Copy link
Contributor

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

Copy link
Member Author

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.

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))
Copy link
Contributor

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?

@alexec
Copy link
Contributor

alexec commented Feb 9, 2021

Awaiting feedback from @jessesuen.

@jessesuen
Copy link
Member

Seems like it would be beneficial without any risk.

@jessesuen jessesuen removed their assignment Feb 10, 2021
@alexec alexec changed the title feat: Add user agent configuration for workflow executor feat(executor): Add user agent configuration for workflow executor Feb 10, 2021
@alexec alexec changed the title feat(executor): Add user agent configuration for workflow executor feat(executor): Add user agent to workflow executor Feb 10, 2021
@alexec alexec merged commit 19a34b1 into argoproj:master Feb 10, 2021
@terrytangyuan terrytangyuan deleted the config-user-agent branch February 10, 2021 20:05
@simster7 simster7 mentioned this pull request Feb 16, 2021
33 tasks
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