Skip to content

Commit

Permalink
log lag
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Feb 19, 2024
1 parent 17b0ad2 commit 04943e3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions flow/connectors/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,7 @@ func (c *PostgresConnector) HandleSlotInfo(
return nil
}

logger.Info(fmt.Sprintf("Checking %s lag for %s", slotName, peerName), slog.Float64("LagInMB", float64(slotInfo[0].LagInMb)))
alerter.AlertIfSlotLag(ctx, peerName, slotInfo[0])

// Also handles alerts for PeerDB user connections exceeding a given limit here
Expand All @@ -918,10 +919,7 @@ func (c *PostgresConnector) HandleSlotInfo(
}
alerter.AlertIfOpenConnections(ctx, peerName, res)

if len(slotInfo) != 0 {
return monitoring.AppendSlotSizeInfo(ctx, catalogPool, peerName, slotInfo[0])
}
return nil
return monitoring.AppendSlotSizeInfo(ctx, catalogPool, peerName, slotInfo[0])
}

// GetLastOffset returns the last synced offset for a job.
Expand Down

0 comments on commit 04943e3

Please sign in to comment.