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: Allow setting of application name to the User-Agent header value #358

Merged
merged 3 commits into from
Oct 27, 2022

Conversation

vlastahajek
Copy link
Contributor

Closes #356

Proposed Changes

Added new option for setting the application name. Application name is then added to the end of Go client version string: E.g. Influxdb-client-go/2.10.0 (linux; amd64) IoTHub/1.10

  • Added also example how to completely overwrite User-Agent header value using the Doer interface

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • Tests pass
  • Commit messages are in semantic format

@vlastahajek vlastahajek changed the title Feat/custom app name feat: Allow setting of application name to the User-Agent header value Oct 12, 2022
@vlastahajek vlastahajek requested a review from sranka October 12, 2022 14:49
client.go Outdated Show resolved Hide resolved
@vlastahajek vlastahajek requested a review from lesam October 13, 2022 12:06
@vlastahajek
Copy link
Contributor Author

@lesam, As you noted in issue #356, there should be an annoying log message, if the application name is unset.
The current state of the logging mechanism is that only errors are shown by default. Thus writing such a message which would be always visible in the log requires writing it as an error.
But, it will introduce this annoying message to all users. This doesn't look like friendly instruction for a new feature. Writing it as a warning seems to be better.
WDYT?

@lesam
Copy link
Contributor

lesam commented Oct 17, 2022

It seems reasonable to start with a warning, put it in the release notes/docs, and then maybe upgrade it to an error message in the next version?

@dgnorton for thoughts as well.

@lesam
Copy link
Contributor

lesam commented Oct 17, 2022

Just leaving it as a warning forever is not sufficient, since it will never be noticed.

@vlastahajek
Copy link
Contributor Author

@lesam, @dgnorton, @powersj, the release is just outside the door, we have to decide if to stay with the error level or change the message to warning.

@vlastahajek
Copy link
Contributor Author

We had an internal discussion in Bonitoo and we are in favor of a warning because such a small feature should not bug users.

Copy link
Contributor

@bednar bednar left a comment

Choose a reason for hiding this comment

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

I prefer to use warning and add a warning to CHANGELOG.md that it will change to error in a future version of the client.

@vlastahajek vlastahajek requested a review from bednar October 27, 2022 09:05
@vlastahajek vlastahajek added this to the v2.12.0 milestone Oct 27, 2022
Copy link
Contributor

@bednar bednar left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@vlastahajek vlastahajek requested a review from sranka October 27, 2022 09:22
@vlastahajek vlastahajek merged commit 47bfa98 into influxdata:master Oct 27, 2022
@vlastahajek vlastahajek deleted the feat/custom-app-name branch October 27, 2022 13:23
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.

Allow overriding the default User-Agent header
4 participants