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

feat(sink): add sink throughput( mb/s) metrics #19587

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xxhZs
Copy link
Contributor

@xxhZs xxhZs commented Nov 27, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Fix #19290.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@@ -200,6 +200,7 @@ impl<F: LogStoreFactory> SinkExecutor<F> {
let input = input.inspect_ok(move |msg| {
if let Message::Chunk(c) = msg {
metrics.sink_input_row_count.inc_by(c.capacity() as u64);
metrics.sink_input_size.inc_by(c.estimated_size() as u64);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the metrics here will be inaccurate when sink decoupling is on because the metrics here is measuring the throughput of the input channel. When sink decoupling is on, the input will be polled and written to log store regardless of the external sink.

We need to add a metric for log store reader throughput:

.inc_by(chunk.cardinality() as _);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like the metric here is log_store_read_rows, which doesn't match the sink_input_row_count we defined earlier. Should we merge the two or add another log_store_read_rows(mb/s)

@stdrc stdrc self-requested a review November 28, 2024 07:47
Comment on lines +973 to +992
panels.timeseries_bytesps(
"Sink Throughput(MB/s)",
"The figure shows the number of bytes written each sink per second. For sinks with 'sink_decouple = true', please refer to the 'Sink Metrics' section",
[
panels.target(
f"(sum(rate({metric('stream_sink_input_size')}[$__rate_interval])) by (sink_id) * on(sink_id) group_left(sink_name) group({metric('sink_info')}) by (sink_id, sink_name)) / (1000*1000)",
"sink {{sink_id}} {{sink_name}}",
),
],
),
panels.timeseries_bytesps(
"Sink Throughput(MB/s) per Partition *",
"The number of bytes streamed into each sink per second. For sinks with 'sink_decouple = true', please refer to the 'Sink Metrics' section",
[
panels.target(
f"(sum(rate({metric('stream_sink_input_size')}[$__rate_interval])) by (sink_id, actor_id) * on(actor_id) group_left(sink_name) {metric('sink_info')}) / (1000*1000)",
"sink {{sink_id}} {{sink_name}} - actor {{actor_id}}",
),
],
),
Copy link
Member

Choose a reason for hiding this comment

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

What's the meaning of * at the end of panel title? And why it's missing in "Sink Throughput(MB/s)"?

Comment on lines -41 to +43
# - use: prometheus # metrics
# - use: tempo # tracing
# - use: grafana # visualization
- use: prometheus # metrics
- use: tempo # tracing
- use: grafana # visualization
Copy link
Member

Choose a reason for hiding this comment

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

Mis op?

@@ -73,6 +73,7 @@ pub struct StreamingMetrics {

// Sink
sink_input_row_count: LabelGuardedIntCounterVec<3>,
sink_input_size: LabelGuardedIntCounterVec<3>,
Copy link
Member

Choose a reason for hiding this comment

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

What about sink_input_bytes which is more consistent with the source one?

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.

Add MB/s metrics for Sink Throughput
3 participants