feat(go): add platform principles and health probes

This commit is contained in:
lingniu
2026-07-02 18:53:02 +08:00
parent 0bfd1191cb
commit 1dfd540700
8 changed files with 339 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ import (
_ "github.com/taosdata/driver-go/v3/taosWS"
"lingniu-vehicle-ingest/go/vehicle-gateway/internal/envelope"
"lingniu-vehicle-ingest/go/vehicle-gateway/internal/health"
"lingniu-vehicle-ingest/go/vehicle-gateway/internal/history"
"lingniu-vehicle-ingest/go/vehicle-gateway/internal/observability"
)
@@ -34,6 +35,9 @@ func main() {
logger.Error("tdengine ping failed", "error", err)
os.Exit(1)
}
health.Start(ctx, logger, health.NewServer(env("HEALTH_ADDR", ""), "vehicle-history-writer", []health.Check{
{Name: "tdengine", Check: db.PingContext},
}))
writer := history.NewWriter(db)
if cfg.EnsureSchema {