diff --git a/backend/pkg/db/postgres/messages-common.go b/backend/pkg/db/postgres/messages-common.go index c21221ebf..0b3039a45 100644 --- a/backend/pkg/db/postgres/messages-common.go +++ b/backend/pkg/db/postgres/messages-common.go @@ -115,7 +115,7 @@ func (conn *Conn) InsertRequest(sessionID uint64, timestamp uint64, index uint64 INSERT INTO events_common.requests ( session_id, timestamp, seq_index, url, duration, success ) VALUES ( - $1, $2, $3, $4, $5, $6 + $1, $2, $3, left($4, 2700), $5, $6 )` conn.batchQueue(sessionID, sqlRequest, sessionID, timestamp, getSqIdx(index), url, duration, success) @@ -129,7 +129,7 @@ func (conn *Conn) InsertCustomEvent(sessionID uint64, timestamp uint64, index ui INSERT INTO events_common.customs ( session_id, timestamp, seq_index, name, payload ) VALUES ( - $1, $2, $3, $4, $5 + $1, $2, $3, left($4, 2700), $5 )` conn.batchQueue(sessionID, sqlRequest, sessionID, timestamp, getSqIdx(index), name, payload) @@ -222,7 +222,7 @@ func (conn *Conn) InsertIssueEvent(sessionID uint64, projectID uint32, e *messag INSERT INTO events_common.customs (session_id, seq_index, timestamp, name, payload, level) VALUES - ($1, $2, $3, $4, $5, 'error') + ($1, $2, $3, left($4, 2700), $5, 'error') `, sessionID, getSqIdx(e.MessageID), e.Timestamp, e.ContextString, e.Payload, ); err != nil { diff --git a/backend/pkg/db/postgres/messages-web-stats.go b/backend/pkg/db/postgres/messages-web-stats.go index 5f0b11e87..396f2e74d 100644 --- a/backend/pkg/db/postgres/messages-web-stats.go +++ b/backend/pkg/db/postgres/messages-web-stats.go @@ -57,7 +57,7 @@ func (conn *Conn) InsertWebStatsResourceEvent(sessionID uint64, e *ResourceEvent ) VALUES ( $1, $2, $3, $4, - $5, $6, $7, + left($5, 2700), $6, $7, $8, $9, NULLIF($10, '')::events.resource_method, NULLIF($11, 0), NULLIF($12, 0), NULLIF($13, 0), NULLIF($14, 0), NULLIF($15, 0) diff --git a/backend/pkg/db/postgres/messages-web.go b/backend/pkg/db/postgres/messages-web.go index 495ca53e4..db5b9d80c 100644 --- a/backend/pkg/db/postgres/messages-web.go +++ b/backend/pkg/db/postgres/messages-web.go @@ -229,7 +229,7 @@ func (conn *Conn) InsertWebFetchEvent(sessionID uint64, savePayload bool, e *Fet duration, success ) VALUES ( $1, $2, $3, - $4, $5, $6, $7, + left($4, 2700), $5, $6, $7, $8, $9, $10::smallint, NULLIF($11, '')::http_method, $12, $13 ) ON CONFLICT DO NOTHING` @@ -261,7 +261,7 @@ func (conn *Conn) InsertWebGraphQLEvent(sessionID uint64, savePayload bool, e *G request_body, response_body ) VALUES ( $1, $2, $3, - $4, + left($4, 2700), $5, $6 ) ON CONFLICT DO NOTHING` conn.batchQueue(sessionID, sqlRequest, sessionID, e.Timestamp, e.MessageID,