Skip to content

Turn on ipfs-cluster's Prometheus metrics on the content node - #9

Merged
TakGN merged 1 commit into
mainfrom
content-cluster-metrics
Oct 19, 2026
Merged

TakGN merged 1 commit into
mainfrom
content-cluster-metrics

Conversation

@TakGN

@TakGN TakGN commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

What

Sets CLUSTER_METRICS_ENABLESTATS=true (and, explicitly, the default CLUSTER_METRICS_PROMETHEUSENDPOINT=/ip4/127.0.0.1/tcp/8888) on the content node's ipfs-cluster container. 8888 was reserved in #8. Loopback only, like every other API of the content node.

The env var name and default endpoint come from ipfs-cluster's observations/config.go. The running service.json on chic1 already has prometheus_endpoint: /ip4/127.0.0.1/tcp/8888 with enable_stats: false.

Why

ipfs-cluster can report what kubo can't: how many pins the cluster holds (ipfscluster_pins), how many are in pin_error, queued or pinning. kubo knows what it holds, not what the cluster wants it to hold. ipni/infra's metrics proxy already has the route (/content/cluster → 127.0.0.1:8888/metrics); the scrape and alerts follow once this is rolled out and the metric names are confirmed live.

Also adds 8888 to the README's port table and roles/content/defaults/main.yml.

Rollout

Not applied by CI. CI runs only site.yml and platform.yml; this needs content.yml, which restarts the content pod (kubo and ipfs-cluster) one box at a time under production_rollout:

ansible-playbook content.yml --check --diff
ansible-playbook content.yml

Check afterwards:

ssh ipni-chic1 curl -s 127.0.0.1:9810/content/cluster | grep '^ipfscluster_pins'

🤖 Generated with Claude Code

ipfs-cluster can report how many pins the cluster holds, how many are in
pin_error, and how many are queued or pinning. kubo cannot: it knows what
it holds, not what the cluster wants it to hold. They are off by default.

CLUSTER_METRICS_ENABLESTATS turns them on, served on 127.0.0.1:8888 (the
default, set explicitly), which #8 reserved and the metrics
proxy in ipni/infra scrapes. Loopback only, like every other API of the
content node. The env var name and the default endpoint are from
ipfs-cluster's observations/config.go; the running service.json shows the
same endpoint with enable_stats false.

Takes effect with content.yml, which restarts the content pod one box at
a time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TakGN
TakGN merged commit 4704a45 into main Oct 19, 2026
9 checks passed
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