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) (err 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) (err 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 the first on-disk datadog-installer that supports the `apm instrument-start`/`instrument-stop` subcommands the unit invokes. The resolved path is baked into the unit's ExecStart/ExecStop. installerPath is "" when no supported installer is found (no candidate on disk, or only older ones); callers must then skip rendering the unit and fall back to direct ld.so.preload management.
func (*SystemdServiceManager) InstallerPath ¶ added in v0.80.2
func (s *SystemdServiceManager) InstallerPath() string
InstallerPath returns the supported datadog-installer path resolved at construction time, or "" if none was found.
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.