-
Notifications
You must be signed in to change notification settings - Fork 524
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
beater: CreatorParams.RunServer -> WrapRunServer #3803
Conversation
Rather than passing in a RunServerFunc to CreatorParams, pass in a function that can wrap a RunServerFunc, like middleware. This enables us to run the tracer server with an overridden reporter, such as the one provided by the transaction histogram aggregator. Unexport beater.RunServer to ensure wrappers do not mistakenly call it directly, rather than going through the RunServerFunc provided to them.
Codecov Report
@@ Coverage Diff @@
## master #3803 +/- ##
==========================================
+ Coverage 79.83% 79.89% +0.06%
==========================================
Files 136 136
Lines 6158 6158
==========================================
+ Hits 4916 4920 +4
+ Misses 1242 1238 -4
|
💚 Build SucceededExpand to view the summary
Build stats
Test stats 🧪
|
@@ -137,7 +135,7 @@ func (bt *beater) Run(b *beat.Beat) error { | |||
} | |||
defer tracer.Close() | |||
|
|||
runServer := bt.runServer | |||
runServer := runServer |
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.
For clarity, can't you move L144 up here, and wrap that same origRunServer
in L166?
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.
I'm not too sure what you mean, but I've extracted this tracer-related code to a separate function. Hopefully that will clarify things, let me know.
* beater: CreatorParams.RunServer -> WrapRunServer Rather than passing in a RunServerFunc to CreatorParams, pass in a function that can wrap a RunServerFunc, like middleware. This enables us to run the tracer server with an overridden reporter, such as the one provided by the transaction histogram aggregator. Unexport beater.RunServer to ensure wrappers do not mistakenly call it directly, rather than going through the RunServerFunc provided to them. * beater: extract runServerWithTracerServer
* beater: CreatorParams.RunServer -> WrapRunServer Rather than passing in a RunServerFunc to CreatorParams, pass in a function that can wrap a RunServerFunc, like middleware. This enables us to run the tracer server with an overridden reporter, such as the one provided by the transaction histogram aggregator. Unexport beater.RunServer to ensure wrappers do not mistakenly call it directly, rather than going through the RunServerFunc provided to them. * beater: extract runServerWithTracerServer
* beater: CreatorParams.RunServer -> WrapRunServer Rather than passing in a RunServerFunc to CreatorParams, pass in a function that can wrap a RunServerFunc, like middleware. This enables us to run the tracer server with an overridden reporter, such as the one provided by the transaction histogram aggregator. Unexport beater.RunServer to ensure wrappers do not mistakenly call it directly, rather than going through the RunServerFunc provided to them. * beater: extract runServerWithTracerServer
* beater: CreatorParams.RunServer -> WrapRunServer Rather than passing in a RunServerFunc to CreatorParams, pass in a function that can wrap a RunServerFunc, like middleware. This enables us to run the tracer server with an overridden reporter, such as the one provided by the transaction histogram aggregator. Unexport beater.RunServer to ensure wrappers do not mistakenly call it directly, rather than going through the RunServerFunc provided to them. * beater: extract runServerWithTracerServer
Motivation/summary
Rather than passing in a RunServerFunc to CreatorParams,
pass in a function that can wrap a RunServerFunc. This
enables us to run the tracer server with an overridden reporter,
such as the one provided by the transaction histogram
aggregator.
We unexport beater.RunServer to ensure wrappers do not
mistakenly call it directly, rather than going through the
RunServerFunc provided to them.
Checklist
- [ ] I have updated CHANGELOG.asciidocI have considered changes for:
- [ ] documentation- [ ] logging (add log lines, choose appropriate log selector, etc.)- [ ] metrics and monitoring (create issue for Kibana team to add metrics to visualizations, e.g. Kibana#44001)- [ ] telemetry- [ ] Elasticsearch Service (https://cloud.elastic.co)- [ ] Elastic Cloud Enterprise (https://www.elastic.co/products/ece)- [ ] Elastic Cloud on Kubernetes (https://www.elastic.co/elastic-cloud-kubernetes)How to test these changes
transaction.duration.histogram
metrics docs for the API requestsRelated issues
Fixes #3801