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

changefeedccl, kv: Add few metrics #77711

Merged
merged 2 commits into from
Mar 14, 2022
Merged

Conversation

miretskiy
Copy link
Contributor

See commits for details.

Release Notes: None
Release justification: Low impact observability improvement

@miretskiy miretskiy requested review from a team as code owners March 12, 2022 00:20
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@miretskiy miretskiy force-pushed the simple_metrics branch 3 times, most recently from 1b33c58 to 421f29b Compare March 12, 2022 23:06
@miretskiy miretskiy requested a review from a team March 12, 2022 23:06
@miretskiy miretskiy force-pushed the simple_metrics branch 2 times, most recently from 796a3f8 to f991596 Compare March 14, 2022 15:40
Copy link
Contributor

@HonoreDB HonoreDB left a comment

Choose a reason for hiding this comment

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

Reviewed 6 of 6 files at r1, 2 of 3 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @erikgrinaker)

Copy link
Contributor

@erikgrinaker erikgrinaker left a comment

Choose a reason for hiding this comment

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

:lgtm: with some nits.

Reviewed 6 of 6 files at r1, 2 of 3 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @miretskiy)


pkg/ccl/changefeedccl/metrics.go, line 90 at r1 (raw file):

const sinkDoesNotCompress = -1

type recordEmittedMessagesCallback func(numMessages int, mvcc hlc.Timestamp, bytes int, compressedBytes int)

Can we get rid of this now, and only use recordOneMessageCallback?


pkg/ccl/changefeedccl/metrics.go, line 346 at r1 (raw file):

		EmittedMessages: b.Counter(metaChangefeedEmittedMessages),
		MessageSize: b.Histogram(metaMessageSize,
			histogramWindow, 10<<20 /* 10MB max message size */, 1),

What happens for messages >10MB? Are they ignored, or do we have a bucket for those that exceed the limit?


pkg/kv/kvclient/kvcoord/dist_sender.go, line 143 at r3 (raw file):

	}
	metaDistSenderRangefeedTotalRanges = metric.Metadata{
		Name: "distsender.rangefeed.catchup_ranges",

This should be total_ranges.


pkg/kv/kvclient/kvcoord/dist_sender.go, line 146 at r3 (raw file):

		Help: `Number of ranges executing rangefeed

This counts the total number of rangefeed ranges.

nit: reword as "number of ranges with an active rangefeed" or something.

Add a histogram metric keeping track fo emitted messages sizes.

Release Note (enterprise change): Changefeed records message size
histogram.

Release Justification: Low impact change.
Copy link
Contributor Author

@miretskiy miretskiy left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @erikgrinaker)


pkg/ccl/changefeedccl/metrics.go, line 90 at r1 (raw file):

Previously, erikgrinaker (Erik Grinaker) wrote…

Can we get rid of this now, and only use recordOneMessageCallback?

Nice. And it's gone.


pkg/ccl/changefeedccl/metrics.go, line 346 at r1 (raw file):

Previously, erikgrinaker (Erik Grinaker) wrote…

What happens for messages >10MB? Are they ignored, or do we have a bucket for those that exceed the limit?

Just a normal histogram nonsense -- these will be truncated; honestly, if your events are more than 10MB... it just a matter of how bad things are.. Cause they are bad.


pkg/kv/kvclient/kvcoord/dist_sender.go, line 143 at r3 (raw file):

Previously, erikgrinaker (Erik Grinaker) wrote…

This should be total_ranges.

Nice. Thanks.


pkg/kv/kvclient/kvcoord/dist_sender.go, line 146 at r3 (raw file):

number of ranges with an active rangefeed
Done.

@miretskiy miretskiy force-pushed the simple_metrics branch 2 times, most recently from 26d121a to 31d92f8 Compare March 14, 2022 19:29
Add 2 metrics to keep track of the total number of ranges
executing rangefeed, as well as the number of ranges currently
performing the catchup scan.

Release Notes: None
Release Justification: Low impact, observability improvement.
Copy link
Member

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 4 of 6 files at r1, 2 of 5 files at r4, 3 of 3 files at r5, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @erikgrinaker)

@miretskiy
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 14, 2022

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants