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§
- Agent
Version - Version of the Datadog Agent that ADP is paired with.
Constants§
- DETECTED_
AGENT_ IS_ DEV truewhen the bundled Agent is a development or pre-release build.- DETECTED_
AGENT_ VERSION - Raw
DD_AGENT_VERSIONstring 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
trueif the Agent version is at leastmajor.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.