Skip to content

Add flags to disable irrelevant integrations#328

Open
gecube wants to merge 1 commit into
coroot:mainfrom
gecube:feature-disable-integrations
Open

Add flags to disable irrelevant integrations#328
gecube wants to merge 1 commit into
coroot:mainfrom
gecube:feature-disable-integrations

Conversation

@gecube

@gecube gecube commented Jul 1, 2026

Copy link
Copy Markdown

Adds opt-in flags to skip integrations that are irrelevant on a given node, so the agent doesn't probe them or report them as unavailable. Companion to #327 (which quiets the benign log lines); this PR lets operators turn the probes off entirely.

New flags (all default to current behavior — auto-detect):

flag env effect
--no-docker NO_DOCKER don't probe the Docker daemon socket
--no-systemd NO_SYSTEMD don't query systemd unit properties over D-Bus
--no-journald NO_JOURNALD don't read the systemd journal
--no-cilium NO_CILIUM don't attach to Cilium eBPF maps
--no-cloud-metadata NO_CLOUD_METADATA don't query the cloud metadata service

Hybrid clusters. Defaults are unchanged: every integration is auto-detected per node, and the cloud provider is detected from DMI per node. That is deliberately the recommended mode for clusters spanning several clouds and bare metal — a single DaemonSet works everywhere. The flags are escape hatches for homogeneous node pools (typically deployed as a pool-scoped DaemonSet via nodeSelector) or locked-down / misdetected environments.

--provider now forces the probe. Previously --provider only set the node_cloud_info label. It now also forces the metadata service of that provider to be queried, overriding auto-detection, so a real cloud node whose DMI is not readable still gets its instance metadata. An empty value keeps per-node auto-detection.

Cilium init. The Cilium map probing is moved out of a package init() into InitCilium(), called after flag parsing from NewRegistry — so it can be gated by --no-cilium and lines up with how the other integrations (docker/containerd/cri-o/journald) are already initialized.

No behavior change with default flags; builds for linux and windows.

Some nodes never have a given integration and the agent shouldn't spend
time probing it or reporting it as unavailable. Add opt-in switches to skip
them:

- --no-docker      don't probe the Docker daemon socket
- --no-systemd     don't query systemd unit properties over D-Bus
- --no-journald    don't read the systemd journal
- --no-cilium      don't attach to Cilium eBPF maps
- --no-cloud-metadata  don't query the cloud metadata service

Defaults keep the current behavior: every integration is auto-detected per
node. This is deliberately the recommended mode for hybrid clusters (several
clouds + bare metal under one control plane) — a single DaemonSet works
everywhere without per-node configuration. The flags are escape hatches for
homogeneous node pools (typically deployed as a pool-scoped DaemonSet) or
locked-down/misdetected environments.

--provider now also forces the metadata service of the given provider to be
queried, overriding auto-detection, so a real cloud node whose DMI is not
readable still gets its instance metadata. An empty value keeps per-node
auto-detection.

Cilium map probing is moved out of a package init() into InitCilium(), called
after flag parsing from NewRegistry, so it can be gated by --no-cilium and
lines up with how the other integrations are initialized.

Signed-off-by: George Gaál <gb12335@gmail.com>
@def def added the AI slop label Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants