Install with an agent¶
This page is the non-interactive contract for Click-Dog, written for coding agents such as Claude Code or Cursor acting on a human's instructions, and for anyone scripting an install. Everything here is also in the human guides; this page puts the machine-checkable parts in one place.
Start from /llms.txt: it indexes every
page with a one-line description and links the JSON schemas, and it names the
Markdown form of each page where one is published.
Decisions to get from the human first¶
The installer cannot guess these, and an agent should not:
| Decision | Why it matters | Where it is explained |
|---|---|---|
The OTLP/gRPC receiver address (-c HOST:PORT) |
Every export goes there; 4317 is only the OTLP default |
Integrations |
Whether the receiver speaks TLS (--otel-secure=true or --otel-secure=false), and with which CA (--otel-ca-cert FILE) |
Unset, a remote receiver gets TLS and a loopback one plaintext; an in-house Collector or Datadog Agent on 4317 often serves plaintext and needs --otel-secure=false, which sends spans and SQL text across the network unencrypted. With TLS, install stops if the receiver does not complete a trusted TLS handshake, and a self-signed or private-CA collector is trusted only through a CA file the human gives you |
Unattended install |
| The ClickHouse monitoring user and its password | The unattended path does not create the user | Kubernetes guide, step 2 has the SQL |
The query-text posture (filters.query_text_mode) |
Decides whether SQL literals leave the host | Security and Privacy |
| Whether ClickHouse may be reconfigured or restarted | system.opentelemetry_span_log must be enabled |
Install prerequisites |
Install without prompts¶
The guided quick start needs a terminal and refuses to run without one. The
unattended path is the install subcommand. The block below is the whole
path: it pins every file to one release, authenticates checksums.txt with
cosign, checks install.sh against it, and only then runs the installer as
root. Supply the ClickHouse password through the environment, never as an
argument, and add --systemd or no service is created:
cd_verify() (
set -euo pipefail
LATEST_URL="$(curl -fsSL -o /dev/null -w '%{url_effective}' \
https://github.com/coltconsulting/click-dog/releases/latest)"
VERSION="${LATEST_URL##*/v}"
BASE="https://github.com/coltconsulting/click-dog/releases/download/v${VERSION}"
for f in install.sh checksums.txt checksums.txt.sig checksums.txt.pem; do
curl -fsSL "${BASE}/${f}" -o "${f}"
done
cosign verify-blob \
--certificate checksums.txt.pem \
--signature checksums.txt.sig \
--certificate-identity-regexp '^https://github\.com/coltconsulting/click-dog/\.github/workflows/release\.yml@refs/tags/v.+$' \
--certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \
checksums.txt
awk '$2 == "install.sh" { print; n++ } END { exit(n == 1 ? 0 : 1) }' checksums.txt > install.sh.sha256
sha256sum -c install.sh.sha256
)
cd_verify
if [ $? -eq 0 ]; then
sudo env CLICKHOUSE_PASSWORD=... bash install.sh install \
-c otel-collector.internal:4317 \
-u click_dog_monitor \
--systemd
else
echo 'click-dog: release verification failed; nothing installed' >&2
fi
cd_verify runs on its own line and the installer is gated on its exit
status, so a failed download, a signature that does not verify, or a missing
cosign stops before anything runs as root. Both details matter: POSIX has
the shell ignore set -e for any command of an AND-OR list other than the
last, and for the condition of an if. So ( ... ) && sudo ... and
if cd_verify; then sudo ... each let a failing step fall through and run the
installer anyway — the subshell keeps going and reports only its last
command's status. The target is a Linux host, hence sha256sum; cosign must
be on PATH, and if it is missing, stop and say so rather than skipping the
check. The installer then verifies the release archive itself the same way.
Never pass --dangerously-ignore-cosign on a human's behalf. Verify
releases explains
each step.
What it writes, all in documented locations, is listed under
What gets installed. A second install is
not an update: use Updating for an existing service.
Without --otel-secure, install asks the release it is installing for the
transport (click-dog init --print-otel-secure): TLS for any receiver that is
not loopback, plaintext for localhost, 127.0.0.0/8, ::1, or a unix:
socket. Pass --otel-secure=true when the human says the receiver speaks TLS
and --otel-secure=false when they say it serves plaintext; always with =,
because --otel-secure false is refused. Explicit or automatic, a remote
receiver's config gets an explicit secure key. TLS is verified against the
host's system trust store, and install first has the release it is
installing complete a TLS handshake with the receiver, using click-dog's own
exporter TLS code: if the receiver does not speak TLS (the error names
--otel-secure=false), presents a certificate the host does not trust, lacks a
subjectAltName for its address, requires a client certificate, or does not
select HTTP/2 (ALPN h2), install exits 1 with the cause before writing
anything (the release is already downloaded to a temporary directory, which
is removed). An unreachable receiver, one that does not answer within 10
seconds or ends the handshake before sending a certificate, or a -b binary
that cannot run on this host, is noted on stderr and not checked. Do not
switch to --otel-secure=false to make that failure go away; report it and
let the human decide. To see the same verdict
yourself, run click-dog test tls --collector HOST:PORT (add
--ca-cert FILE for a CA file); --json gives a stable object.
The unattended path never trusts a certificate on first use. For a
self-signed or private-CA collector, the human supplies the CA, and you pass
it as --otel-ca-cert FILE (it implies TLS and is refused with
--otel-secure=false). Do not fetch the
collector's certificate yourself and pass that: deciding to trust it is the
human's call. install refuses a file that is not PEM, holds no certificate,
or contains a PRIVATE KEY block, then checks the handshake against that
file alone and installs it as /etc/click-dog/tls/ca.pem. Both refusals exit
1 before anything is written. mTLS needs client_cert and client_key,
which only your own configuration can carry.
Useful flags: -v VERSION pins a release, --prerelease selects the newest
public beta, -k HOSTS sets Keeper hosts for HA, -x PROXY routes downloads
through an HTTPS proxy, -b BINARY installs a pre-verified local binary. The
full list is bash install.sh -h.
Bring your own configuration¶
To review the YAML before anything touches the host, render it with the
binary's own generator, then install it with -f:
click-dog init -profile production \
-collector otel-collector.internal:4317 \
-ch-user click_dog_monitor \
-ch-password-file /etc/click-dog/.secret \
-output click-dog.yaml
sudo env CLICKHOUSE_PASSWORD=... bash install.sh install -f click-dog.yaml --systemd
init prompts only when run with no flags on a terminal; with any flag it
is non-interactive, and it refuses to overwrite an existing output file
unless -force is given. Unset, init renders secure: true for a remote
collector and a comment stating the rule for a loopback one, and prints the
transport it chose. Add --otel-secure=false for a receiver that serves
plaintext, --otel-secure=true to state TLS, and --otel-ca-cert PATH for a
self-signed or private-CA one (it renders secure: true and ca_cert: PATH;
the file must exist at that path on the target). init refuses leftover
arguments, so --otel-secure false fails rather than rendering TLS. For mTLS, add
client_cert and client_key under exporters.otel, as shown in
TLS Configuration;
install -f takes neither --otel-secure nor --otel-ca-cert. Profiles are minimal, production and paranoid; the rendered output for each is published as a
reference at
/examples/click-dog-production.yaml,
/examples/click-dog-minimal.yaml and
/examples/click-dog-paranoid.yaml.
Verify, with exit codes¶
Run these as the click-dog user; the config directory is private to it.
Each command exits 0 on success, 1 on failure, and 2 on a usage error.
| Command | Checks | Touches the network |
|---|---|---|
sudo -u click-dog click-dog validate --config /etc/click-dog/click-dog.yaml |
YAML parses and validates; prints the parsed settings and any deprecation warnings | no |
sudo -u click-dog click-dog check --config /etc/click-dog/click-dog.yaml |
ClickHouse connectivity, required grants, recent spans, exporter reachability | yes |
sudo -u click-dog click-dog test export --config /etc/click-dog/click-dog.yaml |
Sends one synthetic span; PASS means the exporter accepted it |
yes |
sudo -u click-dog click-dog test tracing --config /etc/click-dog/click-dog.yaml |
One complete trace through ClickHouse native tracing | yes |
click-dog deploy status --json |
Installed files, service state and versions as JSON | no |
curl -fsS localhost:8686/readyz |
The running service reports ready (200) |
local |
validate is the offline gate to run after every configuration edit, followed
by sudo systemctl restart click-dog. The listeners default to :8686 for
health and :9090 for Prometheus metrics; see Observability.
Configuration contract¶
There is no published JSON Schema for click-dog.yaml yet. The contract is:
- the Configuration reference, whose keys are parity-tested against the Go config struct;
- the three profile renderings above, which are parity-tested against
click-dog init; click-dog validate, which is the authoritative validator. Unknown keys and invalid values fail it; deprecated spellings pass with aWARNline.
Values may reference environment variables as ${VAR}; a reference that is
unset at validation time is reported. Prefer password_file over an inline
password when a systemd unit is involved, since the generated unit has no
EnvironmentFile=.
Machine-readable analysis¶
analyze queries is a read-only, deterministic report over a time window.
For tooling, write JSON to a file and, if the report leaves the host, redact
the user, client and host dimensions:
sudo -u click-dog click-dog analyze queries \
--config /etc/click-dog/click-dog.yaml \
-lookback 1h -format json -output /tmp/click-dog-report.json \
--redact-dimensions
Exit codes: 0 report written, 1 error, 3 a finding met the -fail-on
threshold (-fail-on warning or -fail-on critical; the report is still
written). --notify sends the bounded finding summary to every configured
destination, which is an outbound side effect to confirm with the human.
The output is schema-versioned:
| Artifact | Schema | Example |
|---|---|---|
analysis.report.v1 (ordinary run) |
/schemas/analysis-report-v1.schema.json |
redacted report |
analysis.report.v2 (compared with -baseline) |
/schemas/analysis-report-v2.schema.json |
comparison report |
analysis.baseline.v1 (written by -save-baseline) |
/schemas/analysis-baseline-v1.schema.json |
baseline |
analysis.finding.v1 (each finding) |
/schemas/analysis-finding-v1.schema.json |
in the reports |
analysis.notification.v1 (--notify payload) |
/schemas/analysis-notification-v1.schema.json |
notification summary |
Reports can contain normalized SQL, schema shape, table names, users and hosts. Treat them like logs: keep them local unless the human has chosen otherwise. Query Analysis explains the findings and every flag.
Rules an agent should keep¶
- Never put the ClickHouse password in a command argument, a log, or a file
the human did not ask for.
CLICKHOUSE_PASSWORDin the environment orpassword_fileare the two supported routes. - Click-Dog connects with
readonly=2. It needsSELECTonsystem.opentelemetry_span_logandsystem.query_logand nothing else; do not grant more to make a check pass. - Enabling the span log or restarting ClickHouse is a change to the human's database server. Ask first.
- The unattended
installoverwrites its destination config and secret. Do not point it at a host that already runs Click-Dog. - Removal is
sudo click-dog deploy uninstall(--yesfor automation). It leaves the ClickHouse user and any ClickHouse config you added in place.
Related¶
- Install: the guided path and the same commands with more context
- Verify releases: authenticate the installer and archives
- Configuration: every key and default
- Query Analysis: what the reports contain