Module agent_version

Module agent_version 

Source
Expand description

Agent version detection.

Agent Data Plane is designed to be a drop-in replacement for specific pieces of Datadog Agent functionality, and some of that behavior is version-dependent: a given Agent version may emit an output field, payload shape, or tag that an earlier version did not. To stay byte-for-byte compatible with the Agent it is bundled with, ADP needs to know which Agent version it is paired with.

The Agent version is provided via the DD_AGENT_VERSION environment variable at build time, baked into the binary by build.rs. The converged Agent image build passes it as a Docker build argument, so every ADP binary carries a fixed, immutable version string that reflects the Agent it was compiled alongside.

When DD_AGENT_VERSION is absent at build time (for example, in local development or standalone builds without a bundled Agent), the version is treated as unknown and all version gates default to the most recent behavior.

§Design

This is intentionally a lightweight, hand-rolled version parser rather than a full semantic-versioning implementation: the values we compare against are simple MAJOR.MINOR.PATCH release tags (optionally carrying a flavor or pre-release suffix such as -full or -devel), and we only ever need a “meets this minimum” comparison.

Structs§

AgentVersion
Version of the Datadog Agent that ADP is paired with.

Constants§

DETECTED_AGENT_IS_DEV
true when the bundled Agent is a development or pre-release build.
DETECTED_AGENT_VERSION
Raw DD_AGENT_VERSION string baked in at build time, or empty when unset.
DETECTED_AGENT_VERSION_MAJOR
Major version component of the bundled Agent.
DETECTED_AGENT_VERSION_MINOR
Minor version component of the bundled Agent.
DETECTED_AGENT_VERSION_PATCH
Patch version component of the bundled Agent.

Functions§

meets
Returns true if the Agent version is at least major.minor.patch.
version
Version of the Datadog Agent that ADP is paired with, as detected at build time.
version_string
Raw Agent version string that ADP was built against, as detected at build time.