Skip to content

Explore - Shrink cloudbeat binary size #3564

@eyalkraft

Description

@eyalkraft

Motivation
Cloudbeat's binary size has grown over the last years and months, and has come up several times as a main contributor to the elastic agent's binary (the entire zipped package which includes also beats binaries) and image sizes , which the ingest team aspire to reduce.
We wish to explore ways to shrink cloudbeat's binary size.

Things to check:

  • try measuring which parts of cloudbeat contribute the most to it's binary size. Cloud vendor SDKs? Trivy? libbeat?
  • try tracing back what additions to cloudbeat made it so big? specific PRs which dramatically changes it's size could be good pointer at what impact's cloudbeat's binary size the most.

Some size reduction directions:

  • Make cloudbeat part of the agent binary, so that their shared dependencies will not be duplicated in two binaries. This probably means merging cloudbeat repo into the agent repo as discussed here https://github.com/elastic/ingest-dev/issues/3157
  • Remove cloudbeat or parts of it from specific distros where it doesn't make sense (CSPM on windows binary? create CNVM specific distro? Include some parts of cloudbeat just on the agentless only distro?)
  • CNVM deprecation which will let us remove trivy from cloudbeat, which is suspected as a big binary size contributor.

Definition of done

  • Give measured and data backed recommendation about how to shrink cloudbeat's binary size, or alternative approaches to reducing it's effect on the elastic agent image size (removing cloudbeat from some agent distros?).

Out of scope

  • merging the proposed recommendation

Related tasks/epics

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions