-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add user agent to HTTP client #5724
Add user agent to HTTP client #5724
Conversation
@t2gran The architecture test fails because of a dependency on |
I just checked and the current user agent is "Apache-HttpClient/5.3.1 (Java/21.0.2)". With almost all updaters you can configure the HTTP headers and if you set |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5724 +/- ##
==========================================
Coverage 67.76% 67.76%
Complexity 16471 16471
==========================================
Files 1901 1901
Lines 72113 72114 +1
Branches 7430 7430
==========================================
+ Hits 48868 48869 +1
Misses 20734 20734
Partials 2511 2511 ☔ View full report in Codecov by Sentry. |
866eb39
to
6c956b8
Compare
Btw is it possible to define custom user agent through updater configuration after this? |
Yes, you can set the |
I strongly suggest nudging users to define their own |
@derhuerst I agree that it is a is a best practice for a C2B service, but in this case it is a B2B call, OTP call the RT-Services. In most cases just using "OpenTripPlanner" should be sufficient. I would also recommend having an aggregator service between OTP and the RT-Services - especially if there are many OTP instances. The aggregator should maintain a clean consistent set of updates and remove old updates. It minimize the calls to the RT-Services and keep the latency between the aggregator and OTP down, while removing some of the load from the OTP instances. The aggregator and OTP should be in the same data senter or same cluster. |
For the record, this was discussed in the dev meeting. Dependencies from the framework code to the domain model is not allowed. The solution in this case was to drop the version number from the token. Another alternative is to pass inn the client-name as parameter when the HTTP Client is created. |
Summary
On one of my deployments we also use Entur's Lamassu with ~70 GBFS feeds. OTP's regular GBFS downloading was
leading another developer looking after Lamassu to think that a load test was underway. 😳
For this reason I'm setting a user agent identifying HTTP calls that originate from OTP.
cc @derhuerst @hbruch