-
Notifications
You must be signed in to change notification settings - Fork 88
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
Improve user-agent header to include telemetry information #235
Conversation
lib/dogapi/common.rb
Outdated
req['User-Agent'] = 'dogapi-rb/%{version} (ruby %{ruver}; os %{os}; arch %{arch})' % { | ||
:version => VERSION, | ||
:ruver => RUBY_VERSION, | ||
:os => RbConfig::CONFIG['host_os'].downcase, | ||
:arch => RbConfig::CONFIG['host_cpu'] | ||
} |
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.
We should probably send this always.
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.
What do you mean? We're adding it to each request right now, so that's always unless I'm missing something.
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.
Oh, I see what you mean, will fix.
lib/dogapi/common.rb
Outdated
req['User-Agent'] = 'dogapi-rb/%{version} (ruby %{ruver}; os %{os}; arch %{arch})' % { | ||
:version => VERSION, | ||
:ruver => RUBY_VERSION, | ||
:os => RbConfig::CONFIG['host_os'].downcase, | ||
:arch => RbConfig::CONFIG['host_cpu'] | ||
} | ||
end |
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.
req['User-Agent'] = 'dogapi-rb/%{version} (ruby %{ruver}; os %{os}; arch %{arch})' % { | |
:version => VERSION, | |
:ruver => RUBY_VERSION, | |
:os => RbConfig::CONFIG['host_os'].downcase, | |
:arch => RbConfig::CONFIG['host_cpu'] | |
} | |
end | |
end | |
req['User-Agent'] = 'dogapi-rb/%{version} (ruby %{ruver}; os %{os}; arch %{arch})' % { | |
:version => VERSION, | |
:ruver => RUBY_VERSION, | |
:os => RbConfig::CONFIG['host_os'].downcase, | |
:arch => RbConfig::CONFIG['host_cpu'] | |
} |
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.
It feels like the User-Agent value could be a constant.
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.
True, I can make it a constant.
@jirikuncar all done, please re-review. |
Thanks for the review! Merging. |
What does this PR do?
Makes the user-agent header more useful.
Description of the Change
Alternate Designs
Possible Drawbacks
Verification Process
Additional Notes
Release Notes
Review checklist (to be filled by reviewers)
changelog/
label attached. If applicable it should have thebackward-incompatible
label attached.do-not-merge/
label attached.kind/
andseverity/
labels attached at least.