apminject

package
v0.80.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package apminject implements the apm injector installer

Index

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

type InjectorInstaller struct {
	Env *env.Env
	// contains filtered or unexported fields
}

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.

func (*SystemdServiceManager) Uninstall added in v0.80.0

func (s *SystemdServiceManager) Uninstall(ctx context.Context) (err error)

Uninstall stops, disables, and removes the APM injector systemd service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL