ЛР 6: observability OpenTelemetry/Grafana

This commit is contained in:
2026-11-17 17:13:25 +03:00
parent 470d9d6f1e
commit 7a57ae41f4
45 changed files with 3300 additions and 33 deletions
+32
View File
@@ -0,0 +1,32 @@
ALTER TABLE attachments
ADD COLUMN staging_object_key TEXT;
UPDATE attachments
SET staging_object_key = object_key
WHERE staging_object_key IS NULL;
ALTER TABLE attachments
ALTER COLUMN staging_object_key SET NOT NULL;
CREATE TABLE attachment_variants (
attachment_id UUID NOT NULL REFERENCES attachments (id),
name TEXT NOT NULL,
content_type TEXT NOT NULL,
size_bytes BIGINT NOT NULL,
width INT NOT NULL,
height INT NOT NULL,
sha256 TEXT NOT NULL,
object_key TEXT NOT NULL UNIQUE,
PRIMARY KEY (attachment_id, name)
);
CREATE TABLE attachment_jobs (
job_id UUID PRIMARY KEY,
attachment_id UUID NOT NULL UNIQUE REFERENCES attachments (id),
pipeline_version INT NOT NULL,
attempt INT NOT NULL,
max_attempts INT NOT NULL,
created_at TIMESTAMPTZ NOT NULL
);
CREATE INDEX attachment_jobs_attachment_id_idx ON attachment_jobs (attachment_id);