Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[+] add sent_lag and confirmed_flush_lsn_lag fields to replication metrics #700

Merged
merged 2 commits into from Dec 28, 2023

Conversation

bukem
Copy link
Contributor

@bukem bukem commented Oct 13, 2023

pg_stat_replication.sent_lag and pg_replication_slots.confirmed_flush_lsn

sent_lag measures the amount of WAL data that is pending replication to a specific standby and helps DBA and operators to identify potential performance bottlenecks and optimize the replication process to minimize lag.

The confirmed_flush_lsn of a replication slot indicates the last LSN that has been successfully written to the WAL on the primary server and subsequently replicated to the associated standby server. It can be used as a reference point to ensure replication consistency.

@bukem bukem changed the title Additional metrics based on stat_statements stats Additional useful metrics to track the replication Oct 13, 2023
@pashagolub pashagolub self-assigned this Oct 14, 2023
@pashagolub
Copy link
Collaborator

Thanks. You need to update according files in the metric folder as well

@bukem
Copy link
Contributor Author

bukem commented Oct 16, 2023

updated the files in the metric folder

@pashagolub pashagolub changed the title Additional useful metrics to track the replication [+] add sent_lag and confirmed_flush_lsn_lag fields to replication metrics Oct 24, 2023
@pashagolub
Copy link
Collaborator

Do you think we need to update Grafana dashboards with these new fields? Or are they solely used with Prometheus?

@bukem
Copy link
Contributor Author

bukem commented Nov 22, 2023

@pashagolub not sure if the question is to me or to @kmoppel-cognite . In my opinion, it should be added to the "Replication lag" dashboard.

@pashagolub pashagolub merged commit 61f5454 into cybertec-postgresql:master Dec 28, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants