Skip to content

[docs] Getting Started: fix broken config snippet and wrong sample output - #1433

Merged
manugarg merged 1 commit into
mainfrom
docs-getting-started-fixes
Aug 29, 2026
Merged

manugarg merged 1 commit into
mainfrom
docs-getting-started-fixes

Conversation

@manugarg

Copy link
Copy Markdown
Contributor

Verified each of these against the code and against an actual cloudprober run.

The config snippet wrote an empty file

echo > /tmp/cloudprober.cfg <<EOF

echo ignores stdin, so this produces a 1-byte file containing a newline. Copy-pasting the tutorial left the reader with an empty config and no error — cloudprober just started with no probe. Now uses cat.

The same ten lines also referred to the file three different ways (cloudprober.cfg in the label, /tmp/cloudprober.cfg in the write and run commands, $PWD/cloudprober.cfg in the Docker command — which therefore pointed at a file that didn't exist). Settled on cloudprober.cfg throughout.

The Docker command couldn't be followed

docker run -v ... ghcr.io/cloudprober/cloudprober had no port mapping, while the instructions immediately before and after it say to open localhost:9313. Added -p 9313:9313.

Both sample outputs were wrong

System metrics. The block claimed:

system_disk_usage_free{disk="/dev/sda1"} 5.24e+10
system_net_rx_bytes{intf="eth0"} 1.02e+08

Three problems, all confirmed in probes/system/system_linux.go: the labels are mount_point and iface, not disk and intf; export_individual_stats defaults to false (probes/system/proto/config.proto:15) so a no-config run emits system_*_aggregated_* with no per-device label at all; and every line carries probe="sys_metrics",ptype="system", which the sample omitted. Replaced with lines copied from a real run and added a note about how to get the per-device breakdown.

Prometheus. The block showed # HELP total Total probes. The surfacer emits # TYPE and never # HELP — zero occurrences in internal/surfacers/prometheus/prometheus.go. The ptype label was missing too. Replaced with real output.

Smaller fixes

  • The PromQL wasn't PromQL: success_ratio = rate(success[5m]) / rate(total[5m]) doesn't parse. Also noted that latency is in microseconds unless latency_unit is changed (probes/proto/config.proto:89).
  • "Community Slack" pointed at https://cloudprober.slack.com, which only resolves for people who are already members — a login wall as the last link on the getting-started page. Now uses the /goto/slack-invite/ shortlink like the rest of the site.
  • Added the missing code-fence languages.

Verification

Ran the corrected snippet verbatim; it produces a valid config and the metrics output matches what the page now shows. hugo --gc --minify builds clean, and markdownlint on this file goes from 13 errors to 6 (the 6 remaining are pre-existing: the h5 heading and the install-methods table).

This is the first of a few PRs tidying up the homepage and getting-started pages.

…tput

The "Add Your First Probe" snippet used `echo > file <<EOF`, which ignores
the heredoc and writes an empty file. Copy-pasting it left the reader with a
zero-byte config and no error -- cloudprober just started with no probe.
Switched to `cat`, and settled on a single path (`cloudprober.cfg`) instead
of the three the page used to mix (`cloudprober.cfg`, `/tmp/cloudprober.cfg`,
`$PWD/cloudprober.cfg`).

The Docker command had no port mapping, so the `localhost:9313` instructions
above and below it could not be followed. Added `-p 9313:9313`.

Both sample outputs were wrong:

  - The system-metrics block used `disk` and `intf` labels (they are
    `mount_point` and `iface`), showed per-device series that a no-config run
    does not emit (`export_individual_stats` defaults to false), and dropped
    the `probe`/`ptype` labels that are always present. Replaced with output
    copied from an actual run, plus a note about aggregation.

  - The Prometheus block showed a `# HELP` line, which the surfacer never
    emits, and omitted the `ptype` label. Replaced with real output.

Also: made the PromQL actually be PromQL (`name = expr` does not parse) and
noted that latency is in microseconds by default; pointed "Community Slack"
at the join invite instead of cloudprober.slack.com, which only resolves for
people who are already members; added missing code-fence languages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant