metrics
Build and Publish / BuildAndDeployAmd64 (push) Failing after 3s
Build and Publish / BuildAndDeployArm64 (push) Failing after 5s

This commit is contained in:
2026-07-02 10:37:36 +02:00
parent 26fd6dc970
commit 2e2060da5c
11 changed files with 481 additions and 65 deletions
+9
View File
@@ -98,6 +98,13 @@ func authSecret() []byte {
var podIp = os.Getenv("POD_IP")
var name = os.Getenv("POD_NAME")
// profileMetrics is the shared prometheus instrumentation for the
// profile actor pool and event log. Built once at process start; the
// actor package's touch sites are nil-safe so a test binary could pass
// nil. Package-level so tests in this package can construct a pool
// without re-registering (cart/checkout use the same pattern).
var profileMetrics = actor.NewMetrics("profile")
// loadUCPProfileSigner loads the UCP ECDSA signing key from the path specified in
// the UCP_SIGNING_KEY_PATH environment variable. Returns nil if unset or unreadable.
func loadUCPProfileSigner() *ucp.SigningConfig {
@@ -126,10 +133,12 @@ func main() {
log.Printf("warning: could not create profile data directory %s: %v", profileDir, err)
}
diskStorage := actor.NewDiskStorage[profile.ProfileGrain](profileDir, reg)
diskStorage.SetMetrics(profileMetrics)
poolConfig := actor.GrainPoolConfig[profile.ProfileGrain]{
MutationRegistry: reg,
Storage: diskStorage,
Metrics: profileMetrics,
Spawn: func(ctx context.Context, id uint64) (actor.Grain[profile.ProfileGrain], error) {
ret := profile.NewProfileGrain(id, time.Now())
err := diskStorage.LoadEvents(ctx, id, ret)