-
Notifications
You must be signed in to change notification settings - Fork 30
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
Restructure Packages and remove State Variables #191
Conversation
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.
Here's some initial feedback.
Would it be possible to break this up a little bit? Maybe even just splitting 393aeef out into a separate PR? It's difficult to provide a comprehensive review when there are unrelated changes.
393aeef
to
83b0ce8
Compare
// Init APM Server Transport struct and start http server to receive data from agent | ||
apmServerTransport := extension.InitApmServerTransport(config) | ||
agentDataServer, err := extension.StartHttpServer(ctx, apmServerTransport) | ||
if err != nil { |
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.
There might be a way to remove one of these two calls, in a similar fashion to what we did with logsapi.Subscribe
and logsTransport
.
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.
Thanks @jlvoiseux, looking good.
I'm a bit concerned about races between agents requesting a flush, the completion of the invocation according to runtimeDone, and the flush timer. As it is we could mistakenly think we should flush earlier than we should. I'd like to dig into the requirements a bit here to see if we can simplify things.
After some offline discussions, it seems like what we have is desirable. It would be good to document some of the reasoning in the code (maybe at the select loop in processEvent) for posterity. Still, we need to ensure signals cannot leak between invocations. |
@axw, @felixbarny, thank you for your reviews. I have implemented the related corrections last Friday. To solve the race related to This scenario is avoided by opening and closing the |
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.
Thanks for the updates @jlvoiseux. Although there's still a theoretical race with AgentDoneSignal, it's at least no worse than it was before. Maybe we can eliminate it in the future.
Logs API Issue Fix
Prior to the PR, the default listener address was set as a global variable to
Benchmark |
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.
Thanks for the update! Change looks good.
Motivation / Summary
This PR aims to resolve several tech-debt-related issues, as well as to integrate improvements discussed during past code reviews.
Changes
Move logger to the main package and replace function logging by error processingOut of scope, relevant issue to be created (Restructure files / packages to move towards a flatter structure #192)How to test