Documentation
¶
Overview ¶
Package apminject implements the apm injector installer
Index ¶
- type ApmSocketConfig
- type InjectorInstaller
- func (a *InjectorInstaller) Finish(err error)
- func (a *InjectorInstaller) Instrument(ctx context.Context) (retErr error)
- func (a *InjectorInstaller) InstrumentLDPreload(ctx context.Context) (err error)
- func (a *InjectorInstaller) Remove(ctx context.Context) (err error)
- func (a *InjectorInstaller) Setup(ctx context.Context) error
- func (a *InjectorInstaller) Uninstrument(ctx context.Context) error
- func (a *InjectorInstaller) UninstrumentLDPreload(ctx context.Context) error
- type SystemdServiceManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApmSocketConfig ¶
type ApmSocketConfig struct {
ReceiverSocket string `yaml:"receiver_socket"`
}
ApmSocketConfig is a subset of the agent configuration
type InjectorInstaller ¶
InjectorInstaller installs the APM injector
func NewInstaller ¶
func NewInstaller() *InjectorInstaller
NewInstaller returns a new APM injector installer
func (*InjectorInstaller) Finish ¶
func (a *InjectorInstaller) Finish(err error)
Finish cleans up the APM injector Runs rollbacks if an error is passed and always runs cleanups
func (*InjectorInstaller) Instrument ¶
func (a *InjectorInstaller) Instrument(ctx context.Context) (retErr error)
Instrument instruments the APM injector
func (*InjectorInstaller) InstrumentLDPreload ¶ added in v0.80.0
func (a *InjectorInstaller) InstrumentLDPreload(ctx context.Context) (err error)
InstrumentLDPreload directly adds the injector library to /etc/ld.so.preload. This is called by the systemd service via "datadog-installer apm instrument-start host" and must not attempt to manage systemd (it would loop).
func (*InjectorInstaller) Remove ¶
func (a *InjectorInstaller) Remove(ctx context.Context) (err error)
Remove removes the APM injector
func (*InjectorInstaller) Setup ¶
func (a *InjectorInstaller) Setup(ctx context.Context) error
Setup sets up the APM injector
func (*InjectorInstaller) Uninstrument ¶
func (a *InjectorInstaller) Uninstrument(ctx context.Context) error
Uninstrument uninstruments the APM injector
func (*InjectorInstaller) UninstrumentLDPreload ¶ added in v0.80.0
func (a *InjectorInstaller) UninstrumentLDPreload(ctx context.Context) error
UninstrumentLDPreload directly removes the injector library from /etc/ld.so.preload. This is called by the systemd service via "datadog-installer apm instrument-stop host" and must not attempt to manage systemd (it would loop).
type SystemdServiceManager ¶ added in v0.80.0
type SystemdServiceManager struct {
// contains filtered or unexported fields
}
SystemdServiceManager manages the APM injector systemd service
func NewSystemdServiceManager ¶ added in v0.80.0
func NewSystemdServiceManager() *SystemdServiceManager
NewSystemdServiceManager builds a manager pointing at whichever datadog-installer binary is on disk at call time. Every supported install flow leaves at least one candidate present before apm-inject's post-install runs:
- SSI / DD_NO_AGENT_INSTALL: copyInstallerSSI is invoked before the package install loop in pkg/fleet/installer/setup/common/setup.go, so /opt/datadog-packages/run/datadog-installer-ssi is in place.
- Regular OCI agent install: datadog-agent is installed before datadog-apm-inject, so the agent's embedded installer is in place.
- Legacy deb/rpm: /usr/bin/datadog-installer ships with the package.
func (*SystemdServiceManager) Setup ¶ added in v0.80.0
func (s *SystemdServiceManager) Setup(ctx context.Context) (err error)
Setup writes the embedded service file and enables it for future boots. It also attempts to start the service immediately, but a start failure is non-fatal: the service is still enabled and will start on the next boot. The caller is expected to call InstrumentLDPreload directly to cover the current boot in case the service did not start.