Add build info metric and diagnostic logging for Garmin sync
All checks were successful
Deploy / deploy (push) Successful in 1m44s

- Add phaseflow_build_info metric with version and commit labels
- Inject GIT_COMMIT env var at build time via next.config.ts
- Add logging to all Garmin fetch functions (HRV, body battery, intensity)
- Log API response status codes, actual data values, and errors

This enables verifying which build is deployed and diagnosing
silent failures where Garmin API returns errors but sync reports success.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-15 13:09:29 +00:00
parent 7ed827f82c
commit 85b535f04a
3 changed files with 87 additions and 4 deletions

View File

@@ -47,3 +47,19 @@ export const activeUsersGauge = new promClient.Gauge({
help: "Number of users with activity in the last 24 hours",
registers: [metricsRegistry],
});
// Build info metric: exposes version and git commit for deployment verification
const buildInfo = new promClient.Gauge({
name: "phaseflow_build_info",
help: "Build information with version and git commit",
labelNames: ["version", "commit"] as const,
registers: [metricsRegistry],
});
// Set build info at module load (value is always 1, labels contain the info)
buildInfo
.labels({
version: process.env.npm_package_version || "unknown",
commit: process.env.GIT_COMMIT || "unknown",
})
.set(1);