From 7ae9b3ff3d8f28b0fc19c67d96f6700cf60bb502 Mon Sep 17 00:00:00 2001 From: tamirms Date: Fri, 26 Jul 2024 15:16:13 +0100 Subject: [PATCH] fix logging --- services/horizon/internal/db2/history/main.go | 6 +++--- services/horizon/internal/ingest/main.go | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/services/horizon/internal/db2/history/main.go b/services/horizon/internal/db2/history/main.go index 90face3129..95e1d285f6 100644 --- a/services/horizon/internal/db2/history/main.go +++ b/services/horizon/internal/db2/history/main.go @@ -972,9 +972,9 @@ type tableObjectFieldPair struct { } type LookupTableReapResult struct { - Offset int64 `json:"offset"` - RowsDeleted int64 `json:"rowsDeleted"` - Duration time.Duration `json:"duration"` + Offset int64 + RowsDeleted int64 + Duration time.Duration } // ReapLookupTables removes rows from lookup tables like history_claimable_balances diff --git a/services/horizon/internal/ingest/main.go b/services/horizon/internal/ingest/main.go index 508da0c7da..572bc2569d 100644 --- a/services/horizon/internal/ingest/main.go +++ b/services/horizon/internal/ingest/main.go @@ -857,7 +857,9 @@ func (s *system) maybeReapLookupTables(lastIngestedLedger uint32) { reapLog := log for table, result := range results { totalDeleted += result.RowsDeleted - reapLog = reapLog.WithField(table, result) + reapLog = reapLog.WithField(table+"_offset", result.Offset) + reapLog = reapLog.WithField(table+"_duration", result.Duration) + reapLog = reapLog.WithField(table+"_rows_deleted", result.RowsDeleted) s.Metrics().RowsReapedByLookupTable.With(prometheus.Labels{"table": table}).Observe(float64(result.RowsDeleted)) s.Metrics().ReapDurationByLookupTable.With(prometheus.Labels{"table": table}).Observe(result.Duration.Seconds()) }