fix: initialize counter and histogram metrics at startup

Counter and histogram metrics were absent from Prometheus scrapes until
the first deployment occurred, making it impossible to distinguish
"no deployments" from "exporter not running" in dashboards and alerts.

Initialize all expected label combinations with zero values when the
collector is created so metrics appear in every scrape from startup.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-08 21:29:36 +01:00
parent fd0d63b103
commit 746e30b24f
3 changed files with 178 additions and 2 deletions

View File

@@ -16,7 +16,7 @@ import (
"github.com/urfave/cli/v3"
)
const version = "0.1.10"
const version = "0.1.11"
func main() {
app := &cli.Command{