-
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] Improved redirect support #14125
Conversation
Pinging @elastic/uptime (:uptime) |
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.
Code LGTM.
The thing that took me a while to understand is what exactly an event with 2 redirects looks like
- with the code today
- with the changed code and redirects set to 0
- with the changed code and redirects set to 10
It would be nice if we do a breaking change (which sounds reasonable here) to at least have it super easy for users to understand how their event structure will exactly change with an example.
@ruflin Thanks for the review! I've updated the PR description to include the full list of removed fields when HTTP redirects are enabled. |
@andrewvc I was actually thinking of documentation for our users, something like https://www.elastic.co/guide/en/beats/libbeat/current/breaking-changes-7.4.html |
@andrewvc Not sure if you saw my last comment here: #14125 (comment) I think this is still needed in a follow up PR. |
@ruflin ah, I missed it, will add. |
This patch better handles redirects in heartbeat. It takes a different tack than what was described in elastic#13146 . This PR is on the whole more pragmatic, accomplishing substantive change with undue complication of the schema and beats codebase. Changes in this patch: * Added http.response.redirects field. This is an array of URLs redirected to inclusive of the final destination, exclusive of the original * Utilize the host codepath, rather than the IP codepath for execution of the check, previously only used for proxies in heartbeat, for redirects. This simplifies the code, hides timing data that can be screwy with redirects (things like fine grained DNS resolution). This means that the following fields no longer appear with redirects enabled in the event: http.rtt.content.us, http.rtt.response_header.us, http.rtt.total.us, http.rtt.validate.us, http.rtt.write_request.us. * Default max_redirects: 0 instead of 10 The new default does make this a breaking change, however, we either need to break that setting and preserve the timing information for the common use case of someone checking a non-redirecting URL, or keeping it at 10 but losing the timing info. The third option would be to invest additional eng. effort here to track those numbers across reqs, but the benefit seems, minimal given that they are not displayed in the UI, only in dashboards. (cherry picked from commit 694dac8)
This patch better handles redirects in heartbeat. It takes a different tack than what was described in elastic#13146 . This PR is on the whole more pragmatic, accomplishing substantive change with undue complication of the schema and beats codebase. Changes in this patch: * Added http.response.redirects field. This is an array of URLs redirected to inclusive of the final destination, exclusive of the original * Utilize the host codepath, rather than the IP codepath for execution of the check, previously only used for proxies in heartbeat, for redirects. This simplifies the code, hides timing data that can be screwy with redirects (things like fine grained DNS resolution). This means that the following fields no longer appear with redirects enabled in the event: http.rtt.content.us, http.rtt.response_header.us, http.rtt.total.us, http.rtt.validate.us, http.rtt.write_request.us. * Default max_redirects: 0 instead of 10 The new default does make this a breaking change, however, we either need to break that setting and preserve the timing information for the common use case of someone checking a non-redirecting URL, or keeping it at 10 but losing the timing info. The third option would be to invest additional eng. effort here to track those numbers across reqs, but the benefit seems, minimal given that they are not displayed in the UI, only in dashboards.
This patch better handles redirects in heartbeat. It takes a different tack than what was described in #13146 . This PR is on the whole more pragmatic, accomplishing substantive change with undue complication of the schema and beats codebase.
Changes in this patch:
http.response.redirects
field. This is an array of URLs redirected to inclusive of the final destination, exclusive of the original URL.host
codepath, rather than the IP codepath for execution of the check, previously only used for proxies in heartbeat, for redirects. This simplifies the code, hides timing data that can be screwy with redirects (things like fine grained DNS resolution). This means that the following fields no longer appear with redirects enabled in the event:http.rtt.content.us
,http.rtt.response_header.us
,http.rtt.total.us
,http.rtt.validate.us
,http.rtt.write_request.us
.max_redirects: 0
instead of10
The new default does make this a breaking change, however, we either need to break that setting and preserve the timing information for the common use case of someone checking a non-redirecting URL, or keeping it at
10
but losing the timing info. The third option would be to invest additional eng. effort here to track those numbers across reqs, but the benefit seems, minimal given that they are not displayed in the UI, only in dashboards.