Skip to content
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

Deprecate generating custom Beats #28814

Merged
merged 4 commits into from
Nov 5, 2021

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Nov 4, 2021

What does this PR do?

This PR adds a warning to users who are generating their own Beats. From 8.0.0, it is not going to be supported.

Why is it important?

To manage users' expectations.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

@kvch kvch added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Nov 4, 2021
@elasticmachine
Copy link
Collaborator

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

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Nov 4, 2021
@mergify
Copy link
Contributor

mergify bot commented Nov 4, 2021

This pull request does not have a backport label. Could you fix it @kvch? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@kvch kvch added backport-v7.16.0 Automated backport with mergify backport-v8.0.0 Automated backport with mergify labels Nov 4, 2021
@mergify mergify bot added backport-skip Skip notification from the automated backport with mergify and removed backport-skip Skip notification from the automated backport with mergify labels Nov 4, 2021
@kvch kvch requested a review from jsoriano November 4, 2021 16:24
@elasticmachine
Copy link
Collaborator

elasticmachine commented Nov 4, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-11-04T16:51:54.353+0000

  • Duration: 109 min 14 sec

  • Commit: 600882a

Test stats 🧪

Test Results
Failed 0
Passed 54122
Skipped 5354
Total 59476

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

@kvch kvch requested a review from ruflin November 4, 2021 16:32
@kvch kvch merged commit 0f989b8 into elastic:master Nov 5, 2021
mergify bot pushed a commit that referenced this pull request Nov 5, 2021
mergify bot pushed a commit that referenced this pull request Nov 5, 2021
kvch added a commit that referenced this pull request Nov 5, 2021
(cherry picked from commit 0f989b8)

Co-authored-by: Noémi Ványi <kvch@users.noreply.github.com>
kvch added a commit that referenced this pull request Nov 5, 2021
* Deprecate generating custom Beats (#28814)

(cherry picked from commit 0f989b8)

* Based on origin/7.16

Co-authored-by: Noémi Ványi <kvch@users.noreply.github.com>
Co-authored-by: Noémi Ványi <sitbackandwait@gmail.com>
v1v added a commit to v1v/beats that referenced this pull request Nov 8, 2021
…in-the-package-binareis

* upstream/master:
  allows disable pod events enrichment with deployment name (elastic#28521)
  Remove Docker input from Filebeat (elastic#28817)
  [breaking] Make default_field: false the default for all fields (elastic#28596)
  Osquerybeat: Improve osquery client connect code (elastic#28848)
  Add crawler  metrics into the stats metricset for Enterprise Search (elastic#28790)
  Remove the now deprecated appsearch module from metricbeat (elastic#28850)
  Remove Beat generators (elastic#28816)
  chore: upload files to Google Storage when they exist (elastic#28836)
  Revert "chore(ci): disable E2E tests in Beats (elastic#28715)" (elastic#28812)
  Deprecate generating custom Beats (elastic#28814)
  [Metricbeat] upgrade flatbuffers to 1.12.1 (elastic#28094)
  Osquerybeat: Fix restart flags after previously bad config (elastic#28827)
  Force ECS and JSON logging for libbeat/logp (elastic#28573)
  Filebeat: Error on startup for unconfigured module (elastic#28818)
  Deprecate log input in favour of filestream (elastic#28623)
  Fix some spelling mistakes (elastic#28080)
@georgebridgeman
Copy link

I'd like to hear more about the reason for deprecating custom beat generation.

Is there an issue or discussion where I can find out more? I've only found issues mentioning the work to be done, such as #28427.

@nimarezainia
Copy link
Contributor

@georgebridgeman the beat generator was experimental and not supported by Elastic. All that said we have been spending considerable amount of time debugging custom code to help the community. But due to the fact that it's best effort, it was creating delay in our responsiveness to our customers.
I'm reviewing this. We (I) should have been better at proactively providing notice and an alternative for the community who is building their own.

7.16 is log lived. the community still has access to the beat generator.
Would you be able to let us know how you were using this and whether there are alternatives we could provide?

@georgebridgeman
Copy link

@nimarezainia

the beat generator was experimental and not supported by Elastic.

I don't believe this. It was never stated in any of the Developer Guide documentation, even as of 7.15. If it was known internally, not putting a notice in the docs is very bad form as it gives the community more faith in the framework than it deserves.

All that said we have been spending considerable amount of time debugging custom code to help the community.

I can believe this, but mostly because the documentation is poor. I've contributed code and documentation to beats through work, and even a simple PR to fix documentation took a year to be reviewed. Improving the documentation, or supporting the community to do so, may have reduced the support required.

7.16 is log lived.

Not as long lived as code built using that generator. Pulling support for the generator shows Elastic don't want people to build custom Beats. It's a massive red flag and - going forward - nobody in their right mind is going to invest in building a production Beat for a new data project.

Would you be able to let us know how you were using this and whether there are alternatives we could provide?

I wrote a custom Beat to pull state from Cisco ACI into Elasticsearch (via Logstash). The alternative I'm going to fall back to (we've already committed to reimplement our Beat) is a Python script, with Celery (or similar) to manage the tasks. Any alternative like this requires a lot of functionality that a custom Beat gave for free, like interpreting response codes, backing off, coping with back-pressure, etc. Custom Beats also allow for great observability as you could use Metricbeat easily and see the state in Kibana.

There were plenty of signals that this change was coming. I half-jokingly suggested to colleagues a few months ago that Elastic will deprecate custom Beats before long. I'm just interested in the reasoning for it.

@ruflin
Copy link
Member

ruflin commented Dec 16, 2021

Hi @georgebridgeman As the initial creator of the beat generator I would like to share a bit more background here.

A few years ago we create the beat generator to bring some standardisation on how beats are generated to the community. The list of community beats kept growing on a daily base which was amazing to see. One of the main problems we had, every beat had its own main files and imported X but not Y so when we upgrade libbeat, things didn't work anymore. At least with the beat generator we new more or less what most community beats were using including the folder structure. Having said that, we never did a great job especially across majors to provide enough guidance to the community beats on how to get to the next version.

The beat generator was mostly used by engineers and devops that know their way around Golang, Git etc. If the generator was broken or the docs, people like you @georgebridgeman contributed back to get it fixed (I'm sorry that we didn't get these contributions in quick enough). The goal of the beat generator was to get you off the ground. As soon as you have the beat, the generator becomes mostly useless. The part that changed over the last 2 years is that the expectations changed on what the beats generator does. Instead of focusing on fixing issues around the generator we had users that are missing git, no or old golang versions, go modules problems, platforms we never built it for and so on. Often it was not clear if the issue was the generator or the users system. That doesn't mean we shouldn't have better docs for it.

There are several ways on how to extend beats. One is building your own beat, alternatives are for example taking metricbeat as a shell like auditbeat does and create your own Beat for it with all the modules inside. This is all still possible and your existing community beats will still keep working. What we take away is the templating part. Also it is important to note, beat generator stays around in 7.16 and as you see here in beats 8.x use still 7.x libbeat as nothing has really changed on that front. So the community beats generated with this generator will keep working with 8.x.

One thing that was never great around the beat generator is that even though you got a lot of tooling out of the box with libbeat, it was always quite a bit of work to keep these beats up to date. One of the questions we ask ourself is how we can fix this?

The most fundamental question for me here is if Beats/Elastic needs and extension mechanism for data collection. The answer is simple from my perspective and it is a YES. One of the topics we keep discussing is around an EXEC input, see #18323. You would still get all the Beats magic but you could write your input in your preferred language. With Elastic Agent as supervisor there are now also new options. For example in theory Elastic Agent could run community beats and even manage them. Or Elastic Agent could run just the input piece mentioned above, it could even be delivered as part of an Elastic Package. Be aware, I'm in brainstorming mode here but I want to make it clear, removing beats generator does not mean removing custom beats, these keep working. And on the extension side we are working on ideas how to make it easier to plug in your collection code.

@georgebridgeman I hope the above shares a bit more background information, I really appreciate you chiming in on this issue.

leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…in-the-package-binareis

* upstream/master:
  allows disable pod events enrichment with deployment name (elastic#28521)
  Remove Docker input from Filebeat (elastic#28817)
  [breaking] Make default_field: false the default for all fields (elastic#28596)
  Osquerybeat: Improve osquery client connect code (elastic#28848)
  Add crawler  metrics into the stats metricset for Enterprise Search (elastic#28790)
  Remove the now deprecated appsearch module from metricbeat (elastic#28850)
  Remove Beat generators (elastic#28816)
  chore: upload files to Google Storage when they exist (elastic#28836)
  Revert "chore(ci): disable E2E tests in Beats (elastic#28715)" (elastic#28812)
  Deprecate generating custom Beats (elastic#28814)
  [Metricbeat] upgrade flatbuffers to 1.12.1 (elastic#28094)
  Osquerybeat: Fix restart flags after previously bad config (elastic#28827)
  Force ECS and JSON logging for libbeat/logp (elastic#28573)
  Filebeat: Error on startup for unconfigured module (elastic#28818)
  Deprecate log input in favour of filestream (elastic#28623)
  Fix some spelling mistakes (elastic#28080)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.16.0 Automated backport with mergify backport-v8.0.0 Automated backport with mergify Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants