Export vital metrics that were previously stored as counters inside the TableBackup and LogicalBackup class to Prometheus.
Right now we expose both the per-table and global metrics (for instance, per table per message type counter and global message counter). We might decide to export only the most detailed one and derive the aggregated value from it in the future.
Some refactoring along the way to have a single point of storing metrics:
consolidate all writes via the WriteCommandDataForTable function, reducing the number of places in the code to instrument with prometheus-related metrics
rename SaveRawMessage to processDMLMessage. Since we also used it for the RelationMessage, the change moves the point where we write it to the one when the actual DML message is received (a bit similar to how the TX begin message is treated).
have only one point in code to call the WriteDelta. For that, all writing from the logical backup goes via the WriteCommandDataForTable.
rename StartReplication to LogicalDecoding, since that function neither limited itself to starting, nor did any replication.
move FetchRelationInfo to the relinfo.go.
Miscellaneous small changes, mostly to simplify metrics collection.
Export vital metrics that were previously stored as counters inside the TableBackup and LogicalBackup class to Prometheus.
Right now we expose both the per-table and global metrics (for instance, per table per message type counter and global message counter). We might decide to export only the most detailed one and derive the aggregated value from it in the future.
Some refactoring along the way to have a single point of storing metrics:
consolidate all writes via the WriteCommandDataForTable function, reducing the number of places in the code to instrument with prometheus-related metrics
rename SaveRawMessage to processDMLMessage. Since we also used it for the RelationMessage, the change moves the point where we write it to the one when the actual DML message is received (a bit similar to how the TX begin message is treated).
have only one point in code to call the WriteDelta. For that, all writing from the logical backup goes via the WriteCommandDataForTable.
rename StartReplication to LogicalDecoding, since that function neither limited itself to starting, nor did any replication.
move FetchRelationInfo to the relinfo.go.
Miscellaneous small changes, mostly to simplify metrics collection.