-
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
[Elastic Agent] Disable modules.d in metricbeat #27860
Conversation
Currently when Elastic Agent is started, on post-install of metricbeat the system.yml file in the modules.d directoy is renamed to system.yml.disabled to make sure it is not run. It turns out there might be some edge cases where this does not work. To not rely on renaming of files, instead the modules are fully disabled. Closes elastic#27857
"-E", "management.enabled=true", | ||
"-E", "logging.level=debug", | ||
"-E", "gc_percent=${METRICBEAT_GOGC:100}", | ||
"-E", "metricbeat.config.modules.enabled=false" |
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.
@michalpristas When I initially started this change I was looking for a rule add_config
or similar that the only thing this would od is adding this field to the config. Instead it seems all these configs we pass in as cmd line flags. What is the reason for this?
The concerns I have with it is that when I use inspect
, not sure if the above ones show up and at one point, we might hit some limits on the length of params.
Can you maybe share a bit of background on why we did it this way?
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.
we did this initially to enable management and later on to set debug level nothing else. all the other options here are just using the stuff we introduced initially to have management enabled.
add_config_option sound good but we need to make it clear what to do in case of naming conflict. something like we have with copy rule where we specify overwrite/merge/noop
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.
Managemement and logging can also be set as config options, or does management have to be passed in as environment variable?
nice. i was trying to repro on Windows but i did not hit the case. this seems like a better approach than renaming |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
Manual testing seems to confirm that this change works but I would like to add some test for it too first. |
To simplify the testing, I opened #27862. But it will unfortunately not cover this case yet as it uses a cmd line flag. That could be a follow up PR to introduce cmd line flags and with the golden files in place any change would be directly visible. |
@michalpristas Did not get to setup a Windows envrionment yet to test this manually. If you have one running, would be great if you could test it quickly. |
i can test it |
looks ok, i dont see any errors |
Pinging @elastic/agent (Team:Agent) |
Currently when Elastic Agent is started, on post-install of metricbeat the system.yml file in the modules.d directoy is renamed to system.yml.disabled to make sure it is not run. It turns out there might be some edge cases where this does not work. To not rely on renaming of files, instead the modules are fully disabled. Closes #27857 (cherry picked from commit 41f17ab)
Currently when Elastic Agent is started, on post-install of metricbeat the system.yml file in the modules.d directoy is renamed to system.yml.disabled to make sure it is not run. It turns out there might be some edge cases where this does not work. To not rely on renaming of files, instead the modules are fully disabled. Closes #27857 (cherry picked from commit 41f17ab) # Conflicts: # x-pack/elastic-agent/pkg/agent/program/supported.go
Currently when Elastic Agent is started, on post-install of metricbeat the system.yml file in the modules.d directoy is renamed to system.yml.disabled to make sure it is not run. It turns out there might be some edge cases where this does not work. To not rely on renaming of files, instead the modules are fully disabled. Closes #27857 (cherry picked from commit 41f17ab) Co-authored-by: Nicolas Ruflin <spam@ruflin.com>
* upstream/master: (658 commits) Add complete k8s metadata through composable provider (elastic#27691) Revert "Fix issue where --insecure didn't propogate to Fleet Server ES connection (elastic#27969)" (elastic#27997) Remove deprecated kafka fields (elastic#27938) [Filebeat] Add Base64 encoded HMAC & UUID template functions to httpjson input (elastic#27873) Improve httpjson template function join (elastic#27996) Remove kubernetes.container.image alias (elastic#27898) [Elastic Agent] Golden files for program tests (elastic#27862) [Elastic Agent] Disable modules.d in metricbeat (elastic#27860) libbeat/common/seccomp: provide default policy for linux arm64 (elastic#27955) Fix logger statement in aws-s3 input (elastic#27982) Fix wrong merge (elastic#27976) Fix issue where --insecure didn't propogate to Fleet Server ES connection (elastic#27969) Forward-port 7.14.2 changelog to master (elastic#27975) [Filebeat] Removing duplicate modules (aliases) Observability (elastic#27919) Fix path in vagrant windows script (elastic#27966) [Filebeat] Removing duplicate modules (aliases) and Cyberark (elastic#27915) No changelog for 8.0.0-alpha2 (elastic#27961) Add write access to 'url.value' from 'request.transforms'. (elastic#27937) Docker: remove deprecated fields (elastic#27933) Filebeat: Make all filesets disabled in default configuration (elastic#27762) ...
Currently when Elastic Agent is started, on post-install of metricbeat the system.yml file in the modules.d directoy is renamed to system.yml.disabled to make sure it is not run. It turns out there might be some edge cases where this does not work. To not rely on renaming of files, instead the modules are fully disabled. Closes elastic#27857
Currently when Elastic Agent is started, on post-install of metricbeat the system.yml file in the modules.d directoy is renamed to system.yml.disabled to make sure it is not run. It turns out there might be some edge cases where this does not work. To not rely on renaming of files, instead the modules are fully disabled.
Closes #27857