diff --git a/cmd/prometheus/dashboards/erigon_internals.json b/cmd/prometheus/dashboards/erigon_internals.json index fcc9dccff33..e228b07e8d8 100644 --- a/cmd/prometheus/dashboards/erigon_internals.json +++ b/cmd/prometheus/dashboards/erigon_internals.json @@ -5727,6 +5727,18 @@ "legendFormat": "dirty: {{instance}}", "range": true, "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "tx_retired{instance=~\"$instance\"}", + "interval": "", + "legendFormat": "limit: {{instance}}", + "range": true, + "refId": "C" } ], "title": "Tx Size", diff --git a/dashboards/erigon_custom_metrics/erigon_custom_metrics.internal.json b/dashboards/erigon_custom_metrics/erigon_custom_metrics.internal.json index b8a482cfeb1..11fafbdb2c7 100644 --- a/dashboards/erigon_custom_metrics/erigon_custom_metrics.internal.json +++ b/dashboards/erigon_custom_metrics/erigon_custom_metrics.internal.json @@ -5543,6 +5543,18 @@ "legendFormat": "dirty: {{instance}}", "range": true, "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "tx_retired{instance=~\"$instance\"}", + "interval": "", + "legendFormat": "limit: {{instance}}", + "range": true, + "refId": "C" } ], "title": "Tx Size", diff --git a/erigon-lib/kv/kv_interface.go b/erigon-lib/kv/kv_interface.go index 0c100406dba..6d1cf2a3663 100644 --- a/erigon-lib/kv/kv_interface.go +++ b/erigon-lib/kv/kv_interface.go @@ -85,6 +85,7 @@ var ( TxSpill = metrics.GetOrCreateGauge(`tx_spill`) //nolint TxUnspill = metrics.GetOrCreateGauge(`tx_unspill`) //nolint TxDirty = metrics.GetOrCreateGauge(`tx_dirty`) //nolint + TxRetired = metrics.GetOrCreateGauge(`tx_retired`) //nolint DbCommitPreparation = metrics.GetOrCreateSummary(`db_commit_seconds{phase="preparation"}`) //nolint //DbGCWallClock = metrics.GetOrCreateSummary(`db_commit_seconds{phase="gc_wall_clock"}`) //nolint diff --git a/erigon-lib/kv/mdbx/kv_mdbx.go b/erigon-lib/kv/mdbx/kv_mdbx.go index ac07a325f0e..9bc205c8326 100644 --- a/erigon-lib/kv/mdbx/kv_mdbx.go +++ b/erigon-lib/kv/mdbx/kv_mdbx.go @@ -701,6 +701,7 @@ func (tx *MdbxTx) CollectMetrics() { } kv.TxDirty.SetUint64(txInfo.SpaceDirty) + kv.TxRetired.SetUint64(txInfo.SpaceRetired) kv.TxLimit.SetUint64(tx.db.txSize) kv.TxSpill.SetUint64(txInfo.Spill) kv.TxUnspill.SetUint64(txInfo.Unspill)