fix(observabillity): propagate ctx to every log call and add resource to logging
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 5m5s
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 5m36s

This commit was merged in pull request #187.
This commit is contained in:
2025-06-17 09:42:19 +02:00
parent ff3c7bdf52
commit 6c92206b3c
27 changed files with 288 additions and 266 deletions

View File

@@ -36,7 +36,7 @@ func (s Dashboard) Summary(ctx context.Context, user *types.User, month time.Tim
AND error IS NULL
AND date(timestamp, 'start of month') = date($2, 'start of month')`,
user.Id, month)
err = db.TransformAndLogDbError("dashboard", nil, err)
err = db.TransformAndLogDbError(ctx, "dashboard", nil, err)
if err != nil {
return nil, err
}
@@ -53,7 +53,7 @@ func (s Dashboard) Summary(ctx context.Context, user *types.User, month time.Tim
AND error IS NULL
AND date(timestamp, 'start of month') = date($2, 'start of month')`,
user.Id, month)
err = db.TransformAndLogDbError("dashboard", nil, err)
err = db.TransformAndLogDbError(ctx, "dashboard", nil, err)
if err != nil {
return nil, err
}
@@ -70,7 +70,7 @@ func (s Dashboard) Summary(ctx context.Context, user *types.User, month time.Tim
AND error IS NULL
AND date(timestamp, 'start of month') = date($2, 'start of month')`,
user.Id, month)
err = db.TransformAndLogDbError("dashboard", nil, err)
err = db.TransformAndLogDbError(ctx, "dashboard", nil, err)
if err != nil {
return nil, err
}
@@ -86,7 +86,7 @@ func (s Dashboard) Summary(ctx context.Context, user *types.User, month time.Tim
FROM treasure_chest
WHERE user_id = $1`,
user.Id)
err = db.TransformAndLogDbError("dashboard", nil, err)
err = db.TransformAndLogDbError(ctx, "dashboard", nil, err)
if err != nil {
return nil, err
}
@@ -99,7 +99,7 @@ func (s Dashboard) Summary(ctx context.Context, user *types.User, month time.Tim
FROM account
WHERE user_id = $1`,
user.Id)
err = db.TransformAndLogDbError("dashboard", nil, err)
err = db.TransformAndLogDbError(ctx, "dashboard", nil, err)
if err != nil {
return nil, err
}