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

metrics: add data flow metrics #2763

Merged
merged 19 commits into from
Sep 15, 2021
Merged

Conversation

overvenus
Copy link
Member

@overvenus overvenus commented Sep 7, 2021

What problem does this PR solve?

Add data flow metrics.

image

Also, this PR adds chechkpoint derivative and TiKV traffics

image
image

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation
  • Need to update key monitor metrics in both TiCDC document and official document

Cc #1606

Release note

None

@overvenus overvenus added needs-cherry-pick-release-4.0 Should cherry pick this PR to release-4.0 branch. needs-cherry-pick-release-5.0 Should cherry pick this PR to release-5.0 branch. component/metrics-logging Metrics and logging component. needs-cherry-pick-release-5.1 Should cherry pick this PR to release-5.1 branch. needs-cherry-pick-release-5.2 Should cherry pick this PR to release-5.2 branch. labels Sep 7, 2021
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 7, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3AceShowHand
  • amyangfei

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the release-note-none Denotes a PR that doesn't merit a release note. label Sep 7, 2021
@ti-chi-bot ti-chi-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Sep 7, 2021
@3AceShowHand 3AceShowHand self-requested a review September 9, 2021 02:39
@@ -138,6 +139,7 @@ func (m *mounterImpl) codecWorker(ctx context.Context, index int) error {
pEvent.RawKV.OldValue = nil
pEvent.PrepareFinished()
metricMountDuration.Observe(time.Since(startTime).Seconds())
metricTotalRows.Add(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

how about using Inc(), and shall we delete this metrics when mounter close.

@@ -150,6 +151,7 @@ func (n *sinkNode) flushSink(ctx pipeline.NodeContext, resolvedTs model.Ts) (err

func (n *sinkNode) emitEvent(ctx pipeline.NodeContext, event *model.PolymorphicEvent) error {
if event == nil || event.Row == nil {
log.Warn("skip emit empty rows", zap.Reflect("event", event))
Copy link
Contributor

Choose a reason for hiding this comment

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

zap.Any is preferred than zap.Reflect

@@ -43,16 +44,22 @@ type Manager struct {
flushing int64

drawbackChan chan drawbackMsg

metricsTableSinkTotalRows prometheus.Counter
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we delete this when closing the sink manager?

@@ -237,6 +245,7 @@ func (b *bufferSink) run(ctx context.Context, errCh chan error) {
metricFlushDuration := flushRowChangedDuration.WithLabelValues(advertiseAddr, changefeedID, "Flush")
metricEmitRowDuration := flushRowChangedDuration.WithLabelValues(advertiseAddr, changefeedID, "EmitRow")
metricBufferSize := bufferChanSizeGauge.WithLabelValues(advertiseAddr, changefeedID)
metricTotalRows := bufferSinkTotalRowsCountCounter.WithLabelValues(advertiseAddr, changefeedID)
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Signed-off-by: Neil Shen <[email protected]>
Namespace: "ticdc",
Subsystem: "sink",
Name: "table_sink_total_rows_count",
Help: "total count of rows",
Copy link
Contributor

Choose a reason for hiding this comment

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

can this help text be more detailed

Namespace: "ticdc",
Subsystem: "sink",
Name: "buffer_sink_total_rows_count",
Help: "total count of rows",
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Comment on lines +4472 to +4475
{
"alias": "/.*-rpc/",
"yaxis": 2
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this useless

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it make .*-rpc aligned to y axis.

Comment on lines 5002 to 5005
{
"alias": "/.*processor.*/",
"yaxis": 2
}
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@amyangfei
Copy link
Contributor

CI failed

cdc/sink/metrics.go Outdated Show resolved Hide resolved
@amyangfei
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: e5f7a60

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 13, 2021
@overvenus
Copy link
Member Author

/run-kafka-tests
/run-integration-tests

1 similar comment
@amyangfei
Copy link
Contributor

/run-kafka-tests
/run-integration-tests

@ti-chi-bot
Copy link
Member

@overvenus: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@overvenus
Copy link
Member Author

/run-integration-tests

1 similar comment
@overvenus
Copy link
Member Author

/run-integration-tests

@ti-chi-bot ti-chi-bot merged commit 06a674b into pingcap:master Sep 15, 2021
ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Sep 15, 2021
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #2828.

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Sep 15, 2021
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #2829.

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Sep 15, 2021
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #2830.

ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Sep 15, 2021
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #2831.

@nongfushanquan nongfushanquan added the cherry-pick-approved Cherry pick PR approved by release team. label Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. component/metrics-logging Metrics and logging component. needs-cherry-pick-release-4.0 Should cherry pick this PR to release-4.0 branch. needs-cherry-pick-release-5.0 Should cherry pick this PR to release-5.0 branch. needs-cherry-pick-release-5.1 Should cherry pick this PR to release-5.1 branch. needs-cherry-pick-release-5.2 Should cherry pick this PR to release-5.2 branch. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants