-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Heartbeat] HTTP request should include the beat name and the version as part of the user-agent. #10170
Comments
+1. Not sure what scope you had in mind, but I'd like both Heartbeat (http monitor) and Metricbeat (all the http based pollers) to do this. |
@andrewvc I am a strong believer that all projects (not just beat) should correctly report themselves so I would include Heartbeat and Metricbeat. So probably the best way to do it would be that libbeat provides a thin wrapper over the official Note: Also I think it would be sufficient to just scope the user agent to a beat (and not the feature), so in the case of Metricbeat requests to external service and central management requests to Kibana would have use the same user agent. |
I'm +1 on this for heartbeat. It's a little wonky in that we'd need to let users override it. We do let users set headers, and my feeling is they could disable the UA by setting it to |
WRT the wrapper, one thing about HB is that we override a lot of stuff already. I'll have to look at the code once your wrapper is in, but I'm a little worried we may need to do our own impl. |
@andrewvc Oh, I wonder if we could do the following:
Concerning 2, I am not sure how Golang behave if we explicitly set the user-agent to an empty string. |
I'd love to see this. In operations, the growing number of things that all claim to be Imagine if all the major browsers said "Oh hai, I'm C++". |
Reproducing the text of #14291 here since it's a dupe: Heartbeat currently uses the default golang user-agent Go-http-client/1.1. This appears to be blacklisted by some sites, including our own, when checking some URLs, like https://www.elastic.co/products/beats/heartbeat . You can test the blocked nature of the golang UA by running curl -A "Go-http-client/1.1" -I https://www.elastic.co/products/beats/heartbeat. We should override the default golang UA and use our own, perhaps elastic-heartbeat/VERSION where VERSION is the heartbeat version number. That should be compliant with the relevant RFC https://tools.ietf.org/html/rfc7231#section-5.5.3 . |
By default heartbeat uses the golang user agent, which is blacklisted by a number of services, including elastic.co. URLs like https://www.elastic.co/products/beats/heartbeat do not work with the default go user agent due to such blacklists. This changes the default user agent to be 'elastic_heartbeat'. While the HTTP spec allows UAs to add version numbers to the end this PR does not add the version number for two reasons: 1. Adding the version wouldn't practically be of use to anyone as one UA version numbers for an uptime check aren't practically useful. 2. It would needlessly add complexity to this commit. Resolves elastic#10170 (comment)
Pinging @elastic/uptime (:uptime) |
By default heartbeat uses the golang user agent, which is blacklisted by a number of services, including elastic.co. URLs like https://www.elastic.co/products/beats/heartbeat do not work with the default go user agent due to such blacklists. This changes the default user agent to be 'Elastic Heartbeat/VERSION (PLATFORM INFO)' Resolves #10170 (comment)
By default heartbeat uses the golang user agent, which is blacklisted by a number of services, including elastic.co. URLs like https://www.elastic.co/products/beats/heartbeat do not work with the default go user agent due to such blacklists. This changes the default user agent to be 'Elastic Heartbeat/VERSION (PLATFORM INFO)' Resolves elastic#10170 (comment) (cherry picked from commit 956f87c)
Any reason this wasn't done to Metricbeat as well, for the same reason? In the meantime, I was able to specify the http header via the config file, which overrode the user agent successfully. |
@archon810 can you open a separate issue for that? This issue is closed so it won't get much attention. |
Done. |
By default heartbeat uses the golang user agent, which is blacklisted by a number of services, including elastic.co. URLs like https://www.elastic.co/products/beats/heartbeat do not work with the default go user agent due to such blacklists. This changes the default user agent to be 'Elastic Heartbeat/VERSION (PLATFORM INFO)' Resolves elastic#10170 (comment)
Currently, the HTTP request from beats doesn't contain the agent name of the version number, it would be useful to add the information to help to debug or generating proxy rules.
The text was updated successfully, but these errors were encountered: