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

drainer: Add a metric to track the delay of the downstream #594

Merged
merged 4 commits into from
May 23, 2019

Conversation

suzaku
Copy link
Contributor

@suzaku suzaku commented May 9, 2019

What problem does this PR solve?

Fix Jira Issue

What is changed and how it works?

A new metric checkpoint_delay = now() - most-recent-ts is included.

Check List

Tests

Manual test (confirmed that the new metric appeared in the /metrics endpoint):

# HELP binlog_drainer_checkpoint_delay_seconds How much the downstream checkpoint lag behind
# TYPE binlog_drainer_checkpoint_delay_seconds gauge
binlog_drainer_checkpoint_delay_seconds 15.128

Code changes

Side effects

Related changes

@suzaku
Copy link
Contributor Author

suzaku commented May 9, 2019

@july2993 How do you test p8s metrics?

Copy link
Contributor

@july2993 july2993 left a comment

Choose a reason for hiding this comment

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

How about use Histogram instead of Gauge

drainer/metrics.go Outdated Show resolved Hide resolved
@suzaku
Copy link
Contributor Author

suzaku commented May 15, 2019

/run-all-tests

@suzaku
Copy link
Contributor Author

suzaku commented May 15, 2019

/run-all-tests

@suzaku
Copy link
Contributor Author

suzaku commented May 15, 2019

/run-unit-tests

@suzaku
Copy link
Contributor Author

suzaku commented May 20, 2019

/run-all-tests

1 similar comment
@zhouqiang-cl
Copy link
Contributor

/run-all-tests

@suzaku
Copy link
Contributor Author

suzaku commented May 21, 2019

/run-integration-tests

@suzaku
Copy link
Contributor Author

suzaku commented May 21, 2019

/run-all-tests

@WangXiangUSTC
Copy link
Contributor

LGTM

Copy link
Contributor

@july2993 july2993 left a comment

Choose a reason for hiding this comment

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

please update https://github.com/pingcap/tidb-ansible/blob/master/scripts/binlog.json
and test it.
you can import the binlog.json, edit it and export it.

@suzaku
Copy link
Contributor Author

suzaku commented May 22, 2019

please update https://github.com/pingcap/tidb-ansible/blob/master/scripts/binlog.json
and test it.
you can import the binlog.json, edit it and export it.

I'll update the Grafana dashboard later.
It should be OK to merge this PR now, because it's mainly aimed to be used directly by querying the metric interface.

Copy link
Contributor

@july2993 july2993 left a comment

Choose a reason for hiding this comment

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

rest LGTM

drainer/metrics.go Outdated Show resolved Hide resolved
@july2993 july2993 merged commit 382287e into pingcap:master May 23, 2019
@suzaku suzaku deleted the monitor-drainer-delay branch May 23, 2019 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants