forked from mtusi2026/mtusi2026lab6
Добавить наблюдаемость и проверки отказов для ЛР 6
This commit is contained in:
@@ -15,11 +15,14 @@ import (
|
||||
"github.com/jackc/pgx/v5"
|
||||
"github.com/jackc/pgx/v5/pgconn"
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
|
||||
"mtusi2026/internal/cursor"
|
||||
"mtusi2026/internal/idgen"
|
||||
"mtusi2026/internal/jobs"
|
||||
"mtusi2026/internal/model"
|
||||
"mtusi2026/internal/telemetry"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -55,7 +58,10 @@ func (s *Store) IsChatMember(ctx context.Context, chatID, userID string) (bool,
|
||||
return ok, err
|
||||
}
|
||||
|
||||
func (s *Store) CreateAttachment(ctx context.Context, a model.Attachment) (model.Attachment, error) {
|
||||
func (s *Store) CreateAttachment(ctx context.Context, a model.Attachment) (_ model.Attachment, err error) {
|
||||
ctx, span := telemetry.Tracer.Start(ctx, "db.attachment.accept",
|
||||
trace.WithAttributes(attribute.String("db.system.name", "postgresql")))
|
||||
defer func() { telemetry.Finish(span, err) }()
|
||||
tx, err := s.pool.Begin(ctx)
|
||||
if err != nil {
|
||||
return a, err
|
||||
|
||||
Reference in New Issue
Block a user