elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
12.14k stars 4.91k forks source link

Libbeat diagnostic tooling #28977

Open P1llus opened 2 years ago

P1llus commented 2 years ago

Similar to the new diagnostic commands introduced in Elastic Agent, ref: https://github.com/elastic/beats/pull/28461 https://github.com/elastic/beats/pull/28265

We would like to have something similar to be able to collect diagnostics from beats them self (metricbeat, filebeat etc).

The diagnostic command would run from the *beat binary, and should be able to connect to an already running instance to collect:

  1. The current running configuration (for example both filebeat.yml and the yml of the related enabled modules).
  2. Collect the logs from the log path configured by the running beat instance.
  3. Collect metadata from the running beat like version, OS architecture etc and store it in JSON.
  4. Optional(Also connect to pprof over unix socket/windows named pipes) to collect pprof over X configured time, on X interval.
  5. Gather all information into a ZIP/tar.gz archive so that it can be downloaded by the end user.
elasticmachine commented 2 years ago

Pinging @elastic/integrations (Team:Integrations)

P1llus commented 2 years ago

@michel-laterman

michel-laterman commented 2 years ago

cc @jlind23

elasticmachine commented 2 years ago

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

jlind23 commented 2 years ago

@P1llus heard that you already have some kind of a POC ready for this? Am I right?

endorama commented 2 years ago

Hello, I just wanted to link some related work that has been done on this same topic.

A previous issue that targeted the same feature in beats: https://github.com/elastic/beats/issues/21965 Agent related issue https://github.com/elastic/obs-dc-team/issues/554 Design doc: https://docs.google.com/document/d/17Z_u7tGFiBn7o_mSTeeKoeJFeB6DGbUGm7oZeqjJbi4/edit

P1llus commented 2 years ago

@jlind23 I did a very early POC for this, though the code is very rough and not nearly finished. However the plan was to start working on a more permanent diagnostic command, but then I heard someone was already working on that.

P1llus commented 2 years ago

Hello, I just wanted to link some related work that has been done on this same topic.

A previous issue that targeted the same feature in beats: #21965 Agent related issue elastic/obs-dc-team#554 Design doc: https://docs.google.com/document/d/17Z_u7tGFiBn7o_mSTeeKoeJFeB6DGbUGm7oZeqjJbi4/edit

Absolutely known! :) This was created as a follow-up to a discussion, since the currently merged work was only around elastic-agent, so a separate issue was created, though that might not have been needed in that case.

jlind23 commented 2 years ago

@P1llus following our discussions I have assigned to you.