Skip to main content

Module remote_agent

Module remote_agent 

Source
Expand description

Remote agent registration and the services that the Datadog Agent queries.

RemoteAgentBootstrap registers the process with the Datadog Agent over the Remote Agent Registry, keeps that registration alive, and creates everything that depends on it: the configuration stream, and the workers that serve the status, flare, and telemetry services and report diagnostic events back to the Datadog Agent.

§Bootstrapping prior to supervision

Registration and the initial configuration are generally required before any decisions can be made about continuing to start up, and this means that a supervision tree is not likely to yet be running where we can spawn our background tasks for managing registration.

The registration loop and the configuration stream loop therefore each start early, in a ResumableWorker, and run in a task until their worker takes them over in the supervision tree. The worker continues with the same session, refresh schedule, and open stream, and so does each restart of the worker.

The registration task finishes a registration attempt in flight before it hands over, so a handoff never registers twice. The registration worker shuts down brutally, even in the middle of an attempt, and a restarted worker retries an interrupted attempt right away. Dropping a loop’s worker before it starts cancels the loop.

Structs§

ConfigStreamWorker
A worker that feeds the config stream from RemoteAgentBootstrap::create_config_stream.
DataspaceAnchorWorker
A worker that captures the dataspace from the supervisor context and stores it in a shared OnceLock for use by the diagnostic artifact collection service.
RemoteAgentBootstrap
Remote agent initialization.
RemoteAgentEventReporter
A worker that reports diagnostic events to the Core Agent as remote agent events.
RemoteAgentRegistrationWorker
A worker that keeps the registration with the Core Agent alive.
RemoteAgentServicesWorker
A worker that serves the status, flare, and telemetry services on the privileged API endpoint.
StatusBuilder
Builder for the status details reported to the Datadog Agent.
StatusSectionWriter
Writer for the fields of a single status section.

Traits§

StatusSectionProvider
A provider of status details for the Datadog Agent’s status output.