-
Notifications
You must be signed in to change notification settings - Fork 556
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
Set zbctl user agent #9434
Set zbctl user agent #9434
Conversation
In order to distinguish between go-client and zbctl add a new possibility to set the UserAgent as client config. Zbctl use that config and set their own user agent header. This is useful to understand which client types and versions are mostly used.
@@ -164,6 +166,61 @@ func (s *clientTestSuite) TestGatewayAddressEnvVar() { | |||
s.EqualValues(fmt.Sprintf("0.0.0.0:%s", parts[len(parts)-1]), config.GatewayAddress) | |||
} | |||
|
|||
func (s *clientTestSuite) TestDefaultUserAgent() { | |||
// given | |||
var incomingContext = make(map[string][]string) |
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.
❓ Found no better way to verify it. Happy to hear your thoughts
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.
Other than moving createServerWithUnaryInterceptor
to some sort of test utility file there's nothing I can think of improving here. We want to test that whoever serves go client requests receives a user-agent header and that that header includes the name and versions so this test looks spot on 👍
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.
Would be interesting @menski whether you think we should backport this so we have the data also in earlier versions.
Note: @oleschoenburg the output of https://github.com/camunda/zeebe/runs/6527128287?check_suite_focus=true is not really useful :D do we have this on the radar? Update: I was not aware that I can see the notes in the diff 👍 |
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 @Zelldon, took me a while to figure out where the version is coming from but I got it now. LGTM
@@ -164,6 +166,61 @@ func (s *clientTestSuite) TestGatewayAddressEnvVar() { | |||
s.EqualValues(fmt.Sprintf("0.0.0.0:%s", parts[len(parts)-1]), config.GatewayAddress) | |||
} | |||
|
|||
func (s *clientTestSuite) TestDefaultUserAgent() { | |||
// given | |||
var incomingContext = make(map[string][]string) |
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.
Other than moving createServerWithUnaryInterceptor
to some sort of test utility file there's nothing I can think of improving here. We want to test that whoever serves go client requests receives a user-agent header and that that header includes the name and versions so this test looks spot on 👍
bors r+ |
Successfully created backport PR #9467 for |
Successfully created backport PR #9468 for |
Description
In order to distinguish between go-client and zbctl this PR adds a new possibility to set the UserAgent as client config.
Zbctl use that config and set its own user-agent header.
This is useful to understand which client types and versions are mostly used. See slack https://camunda.slack.com/archives/CHBFBRFM2/p1652420371478469?thread_ts=1651237779.179459&cid=CHBFBRFM2
Related issues
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
backport stable/1.3
) to the PR, in case that fails you need to create backports manually.Testing:
Documentation:
Please refer to our review guidelines.