-
Notifications
You must be signed in to change notification settings - Fork 527
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
Rework beater package #2489
Comments
simitt
added a commit
to simitt/apm-server
that referenced
this issue
Jul 24, 2019
Related to elastic#2489
This was referenced Jul 24, 2019
simitt
added a commit
to simitt/apm-server
that referenced
this issue
Jul 24, 2019
Related to elastic#2489
simitt
added a commit
to simitt/apm-server
that referenced
this issue
Jul 24, 2019
Related to elastic#2489
simitt
added a commit
to simitt/apm-server
that referenced
this issue
Jul 24, 2019
Related to elastic#2489
simitt
added a commit
to simitt/apm-server
that referenced
this issue
Jul 24, 2019
Related to elastic#2489
simitt
added a commit
to simitt/apm-server
that referenced
this issue
Jul 24, 2019
Related to elastic#2489
This was referenced Jul 24, 2019
simitt
added a commit
to simitt/apm-server
that referenced
this issue
Jul 30, 2019
Related to elastic#2489
simitt
added a commit
to simitt/apm-server
that referenced
this issue
Jul 31, 2019
Related to elastic#2489
simitt
added a commit
to simitt/apm-server
that referenced
this issue
Jul 31, 2019
Related to elastic#2489
simitt
added a commit
that referenced
this issue
Aug 5, 2019
Change response write handling to set a response per context and then call write on the context. Introduce a shared beatertest package with testing helper structs and methods. Related to #2489
simitt
added a commit
to simitt/apm-server
that referenced
this issue
Aug 5, 2019
Create several packages inside the beater directory to better organize http framework logic. Adapt tests and code to new structure. related to elastic#2489
simitt
added a commit
to simitt/apm-server
that referenced
this issue
Aug 5, 2019
Create several packages inside the beater directory to better organize http framework logic. Adapt tests and code to new structure. related to elastic#2489
simitt
added a commit
that referenced
this issue
Aug 6, 2019
* [beater] Restructure beater package and some more test Create several packages inside the beater directory to better organize http framework logic. Adapt tests and code to new structure. related to #2489
simitt
added a commit
to simitt/apm-server
that referenced
this issue
Aug 7, 2019
Change response write handling to set a response per context and then call write on the context. Introduce a shared beatertest package with testing helper structs and methods. Related to elastic#2489
simitt
added a commit
to simitt/apm-server
that referenced
this issue
Aug 7, 2019
* [beater] Restructure beater package and some more test Create several packages inside the beater directory to better organize http framework logic. Adapt tests and code to new structure. related to elastic#2489
Merged
simitt
added a commit
that referenced
this issue
Aug 20, 2019
* [beater] Add context handlers and adapt log handling (#2492 ) related to #2201 * [beater] Introduce middleware logic and dedicated monitoring middleware (#2493) partially implements #2142 * [beater] Improve Response Writing (#2494) Change response write handling to set a response per context and then call write on the context. Introduce a shared beatertest package with testing helper structs and methods. related to #2489 * [beater] Restructure beater package (#2518) Create several packages inside the beater directory to better organize http framework logic. Adapt tests and code to new structure. related to #2489 * More beater coverage (#2582) Co-Authored-By: Gil Raphaelli <[email protected]>
simitt
added a commit
to simitt/apm-server
that referenced
this issue
Aug 20, 2019
* [beater] Add context handlers and adapt log handling (elastic#2492 ) related to elastic#2201 * [beater] Introduce middleware logic and dedicated monitoring middleware (elastic#2493) partially implements elastic#2142 * [beater] Improve Response Writing (elastic#2494) Change response write handling to set a response per context and then call write on the context. Introduce a shared beatertest package with testing helper structs and methods. related to elastic#2489 * [beater] Restructure beater package (elastic#2518) Create several packages inside the beater directory to better organize http framework logic. Adapt tests and code to new structure. related to elastic#2489 * More beater coverage (elastic#2582) Co-Authored-By: Gil Raphaelli <[email protected]>
simitt
added a commit
that referenced
this issue
Aug 20, 2019
* [beater] Add context handlers and adapt log handling (#2492 ) related to #2201 * [beater] Introduce middleware logic and dedicated monitoring middleware (#2493) partially implements #2142 * [beater] Improve Response Writing (#2494) Change response write handling to set a response per context and then call write on the context. Introduce a shared beatertest package with testing helper structs and methods. related to #2489 * [beater] Restructure beater package (#2518) Create several packages inside the beater directory to better organize http framework logic. Adapt tests and code to new structure. related to #2489 * More beater coverage (#2582) Co-Authored-By: Gil Raphaelli <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
beater
package deals with a couple of technical debts at the moment. This is a meta issue to discuss issues and how to address them.The
logging
andmonitoring
handling is spread all over the package, leading to errors and not fully logged and monitored requests (e.g. ACM requests increase counter for requests, but not for responses).The response writer logic needs some refactoring to have a unique and more idiomatic way of writing responses and errors. Response handling should be separated from increasing monitoring counters.
After some research the suggested solution is to introduce a
Context
struct pool. AContext
is passed around betweenHandlers
within one request, abstracting thehttp.ResponseWriter
and the*http.Request
. For every new request the context pool takes care of reusing an idle context, and resetting it to the current request.Introducing a
Context
allows for better separation of concerns for the single middleware handlers, while reusing structs to increase performance.Since this is a larger effort, the changes will be introduced in separate PRs, directed against a feature branch. Once all changes are in and all tests are accordingly adapted, the feature branch will be merged against master.
Separating the effort into following tasks:
Context
and centralizinglogging
([beater] Add context handlers and adapt log handling #2492 )monitoring
handling ([beater] Introduce middleware logic and dedicated monitoring middleware #2493 )error
and unify used terminology ([self instrumentation] Enhance Logging #2201 )root
andasset
routes. (Rework request and response counters #2142 )The text was updated successfully, but these errors were encountered: