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

Improve user-agent header to include telemetry information #235

Merged
merged 3 commits into from
Jul 2, 2020

Conversation

bkabrda
Copy link
Contributor

@bkabrda bkabrda commented Jul 2, 2020

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)

  • Feature or bug fix MUST have appropriate tests (unit, integration, etc...)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have one changelog/ label attached. If applicable it should have the backward-incompatible label attached.
  • PR should not have do-not-merge/ label attached.
  • If Applicable, issue must have kind/ and severity/ labels attached at least.

@bkabrda bkabrda added the changelog/Added Added features results into a minor version bump label Jul 2, 2020
@bkabrda bkabrda requested a review from a team as a code owner July 2, 2020 08:12
Comment on lines 145 to 150
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']
}
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Comment on lines 145 to 151
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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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']
}

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@bkabrda
Copy link
Contributor Author

bkabrda commented Jul 2, 2020

@jirikuncar all done, please re-review.

@bkabrda
Copy link
Contributor Author

bkabrda commented Jul 2, 2020

Thanks for the review! Merging.

@bkabrda bkabrda merged commit 9ccd737 into master Jul 2, 2020
@bkabrda bkabrda deleted the slavek.kabrda/user-agent-for-telemetry branch July 2, 2020 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/Added Added features results into a minor version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants