Skip to content

[Installer] Allow Extra CLI Flags #13111

@pickypg

Description

@pickypg

Describe the enhancement:

Sometimes you need to specify extra CLI flags to a process running as a service (often just for debugging). This is usually done (i.e., with the JVM) via an otherwise unused environment variable.

For Linux, when installing the Elastic Agent as a Service, end users can modify the startup command by first unsetting, then setting ExecStart under [Service]. It is inherently going to be different for Windows and macOS service installations.

For example:

[Service]
ExecStart=
ExecStart=/usr/bin/elastic-agent run --param-goes-here

Describe a specific use case for the enhancement or feature:

This is helpful when debugging certain scenarios, as well as applying workarounds.

For example, the Linux installation of AutoOps for Self-managed (using Cloud Connect), which runs in OTel mode, would heavily benefit from adding two CLI parameters until 9.3.2 is released to workaround an issue with the pre-installed configuration (otel_samples/autoops_es.yml) that the installer makes use of. If we could provide custom CLI arguments, then we could provide a workaround without getting the user to modify the file.

--set exporters::otlphttp::sending_queue::sizer=requests --set exporters::otlphttp::sending_queue::batch::sizer=bytes

As a compounding issue, the above CLI flags do not work with the service because they are OTel flags and the way that the service starts (at least in 9.3.1), it appears to not recognize the flags until it is too late in the process startup -- and thus startup fails. What that means is that, for EDOT purposes, you cannot even use something like

[Service]
ExecStart=
ExecStart=/usr/bin/elastic-agent otel --set exporters::otlphttp::sending_queue::sizer=requests --set exporters::otlphttp::sending_queue::batch::sizer=bytes

What is the definition of done?

  • CLI flags can be optionally added after installation.
  • CLI flags can be provided that only work with the OTel behavior without causing issues when starting in otel mode.

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