monitoring: expose GoatCounter statistics to Grafana via a textfile exporter #300
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra#300
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
A Grafana dashboard for GoatCounter statistics is not possible today — no datasource can reach the
data, and no GoatCounter signal reaches either existing datasource. This issue is the enabling work.
Why it does not work now
-db=sqlite+/data/goatcounter.sqlite3, inside a rootlesspodman named volume. Not network-reachable, not mounted into the Grafana container.
goat|gc_|analytic|pageview|visitorreturns nothing relevant; GoatCounter2.7 exposes no
/metricsand there is no scrape job for it. The only signal in the TSDB isprobe_success{instance="https://stats.gitborg.se"}— liveness, zero analytics.gitborgplay, so themonitoring VM ships none of its own container logs. Even if it did, stdout is request noise, not
pageview aggregates.
yesoreyeram-infinity-datasourcenorfrser-sqlite-datasourceis installed.Recommended path — textfile exporter
A
gitborg-user timer on the monitoring VM curls the GoatCounter API (/api/v0/stats/total,/api/v0/stats/hits) with a token from vault, and writes node_exporter textfile metrics such asgitborg_goatcounter_pageviews_total,_visitors_totaland_pageviews_by_path{path=…}. The existinglocal
nodescrape picks them up with no new datasource, no new plugin and no new inbound exposure.This is the pattern the repo already uses for backup, reconciler, renovate and token-audit metrics,
so it needs no new concepts, and it gets alerting via vmalert for free. Limitation: only the aggregates
modelled up front; no ad-hoc referrer or browser exploration.
Then add a code-defined
bitborg-analytics.jsondashboard alongside the others.Alternatives considered and rejected
conflicts with the deliberate no-phone-home posture (
GF_PLUGINS_PREINSTALL_DISABLED=true,GF_ANALYTICS_CHECK_FOR_PLUGIN_UPDATES=false, principle 1 / ADR 0020). Would need the pluginvendored and installed from a local URL.
a live SQLite database and dashboards coupled to GoatCounter's internal schema.
services host and ADR 0020 §2 deliberately opens nothing new inbound there.
Bonus if the exporter lands: attaching Alloy to the monitoring VM in the same change also closes the
"monitoring host ships none of its own logs" gap.