Skip to content

Emit binlog backlog metrics#39

Merged
forge33 merged 2 commits into
masterfrom
pb/emit_binlog_backlog_metrics
Jun 1, 2026
Merged

Emit binlog backlog metrics#39
forge33 merged 2 commits into
masterfrom
pb/emit_binlog_backlog_metrics

Conversation

@forge33
Copy link
Copy Markdown

@forge33 forge33 commented May 27, 2026

Related issue: github#1672
Closes: https://github.com/Shopify/schema-migrations/issues/5454

Description

This PR emits binlog backlog metrics in order to see how much back pressure exists for the binlog channel:

  • binlog.backlog_size
  • binlog.backlog_capacity
  • binlog.backlog_utilization

This can be visualized as the binlog apply queue panel below
Screenshot 2026-05-27 at 10 40 40 AM

In case this PR introduced Go code changes:

  • contributed code is using same conventions as original code
  • script/cibuild returns with no formatting errors, build errors or unit test errors.

@forge33 forge33 force-pushed the pb/emit_row_copy_metrics branch from f67a1c9 to 941650e Compare May 28, 2026 13:27
@forge33 forge33 force-pushed the pb/emit_binlog_backlog_metrics branch from a268db3 to fdce897 Compare May 28, 2026 13:47
@forge33 forge33 changed the base branch from pb/emit_row_copy_metrics to master May 28, 2026 13:52
@forge33 forge33 marked this pull request as ready for review May 28, 2026 14:00
@forge33 forge33 requested review from coding-chimp and grodowski May 28, 2026 14:11
Comment thread go/metrics/binlog_backlog_test.go Outdated
emit.Gauge("binlog.backlog_utilization", binlogBacklogUtilization(backlogSize, backlogCapacity))
}

func binlogBacklogUtilization(backlogSize, backlogCapacity int) float64 {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How useful is this, assuming we can get a similar result with a custom metric definition? (YAGNI?)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I thought a bit about this one whether to leave it or not. I think we may not use it, other folks may, so I decided to leave it in

@grodowski grodowski added the #gsd:50633 Data Storage: gh-ost Observability Instrumentation label May 28, 2026
@forge33 forge33 merged commit a9ef88b into master Jun 1, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50633 Data Storage: gh-ost Observability Instrumentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants