-
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
Fixed monitoring filebeat and metricbeat not connecting to Agent over GRPC #23843
Conversation
Pinging @elastic/ingest-management (Team:Ingest Management) |
Pinging @elastic/agent (Team:Agent) |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
/packaging |
/package |
@michalpristas Could we add a unit to cover us from regression? |
@michalpristas Thanks for sorting this out. My bad! I agree with @ph a unit test would be great for this case, so the test will ensure any future changes will not break it. |
The unit test is certainly closer to the code and faster to find and review, and is never skipped I suppose. But we did have a test that covered it, which is nice. What I find interesting is that the nightly test caught it, when it could (I think) have been caught in the PR CI test run of /package - I think we should restart the discussion on having those run automatically for all changes that include to Libbeat, Filebeat, Metricbeat and Agent - @mdelapenya @ph any thoughts on priority of that? |
I'd traced back what happened on CI here: #23833 (comment) |
@michalpristas will you followup with a unit test? |
@EricDavisX Maybe the trigger would be only libbeat and Agent, that should cover 90% of the use case? |
… GRPC (elastic#23843) Fixed monitoring filebeat and metricbeat not connecting to Agent over GRPC (elastic#23843)
I would be fine with that - if it saves us a lot from the other Beats side, with most of the coverage we want |
… Fleet Server (#23785) * [Elastic Agent] Add the ability to run the Fleet Server (#23736) * Add the ability to run the Fleet Server. * Add test and changelog. * Fix changelog. (cherry picked from commit d59f780) * Fixed monitoring filebeat and metricbeat not connecting to Agent over GRPC (#23843) Fixed monitoring filebeat and metricbeat not connecting to Agent over GRPC (#23843) Co-authored-by: Michal Pristas <michal.pristas@gmail.com>
What does this PR do?
In PR #23736 there was a populate method removed which in case spec is not complete reloaded it from the spec file.
Spec was indeed in some cases incomplete it depends where the request came from. If it was normal one from emitter it was complete and beat was stable.
If it was from monitoring injector it was just a naked spec with only cmdName to run, this one was populated, in a removed populate func.
Having naked spec means no args are passed into the beat and beat does not know it is agent-managed, so it wont even try to connect back. It just runs with the default configuration until agent restarts it.
This change goes from generating naked spec file to loading it from spec definition at the time of injecting monitoring. which means only complete specs comes to the place where populate func was before and correct Args are passed to process.
Why is it important?
Fixes #23833
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.