Registry Mirror
Skip to content

Conversation

@gruuya

@gruuya gruuya commented Jun 20, 2024

Copy link
Copy Markdown
Contributor

Add metrics tracking byte size/row count for:

  • incoming request
  • compaction
  • flushing
    as well as timings for the last two ops.

@gruuya
gruuya changed the base branch from main to datafusion-39-upgrade June 20, 2024 07:27
@gruuya
gruuya requested a review from mildbyte June 20, 2024 07:27
Comment thread src/frontend/flight/sync/metrics.rs Outdated
Comment on lines +6 to +11
const REQUEST: &str = "seafowl_sync_writer_request";
const IN_MEMORY: &str = "seafowl_sync_writer_in_memory";
const COMPACTION_TIME: &str = "seafowl_sync_writer_compaction_time";
const COMPACTED: &str = "seafowl_sync_writer_compacted";
const FLUSHING_TIME: &str = "seafowl_sync_writer_flushing_time";
const FLUSHED: &str = "seafowl_sync_writer_flushed";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

https://prometheus.io/docs/practices/naming/

The rule of thumb for these is that if you sum up some metric by all possible label values, it should still be a meaningful value, so we can't have different units in the same metric, instead:

# counter: total rows requested and total size of requests
seafowl_sync_writer_requests_rows_total
seafowl_sync_writer_requests_bytes_total

# gauges: how many rows in memory and how much space do they take
seafowl_sync_writer_in_memory_rows_total
seafowl_sync_writer_in_memory_bytes_total

# histogram: time taken by compaction
seafowl_sync_writer_compaction_time_seconds

# counter: total rows compacted, amount and size
seafowl_sync_writer_compacted_rows_total
seafowl_sync_writer_compacted_bytes_total

# histogram: time taken by flushes
seafowl_sync_writer_flushed_time_seconds

# counter: total rows flushed, amount and size
seafowl_sync_writer_flushed_bytes_total
seafowl_sync_writer_flushed_rows_total

Comment thread src/frontend/flight/sync/metrics.rs Outdated
Gauge, Histogram,
};

const REQUEST: &str = "seafowl_sync_writer_request";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should rename this sync to something else, seafowl_delta_writer? seafowl_writer? seafowl_changeset_writer?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll go with seafowl_changeset_writer.

Comment thread src/frontend/flight/sync/writer.rs Resolved
Comment thread src/frontend/flight/sync/writer.rs Resolved
Base automatically changed from datafusion-39-upgrade to main June 20, 2024 13:05
Comment thread src/frontend/flight/sync/metrics.rs Outdated
const REQUEST_ROWS: &str = "seafowl_changeset_writer_request_rows";
const IN_MEMORY_BYTES: &str = "seafowl_changeset_writer_in_memory_bytes";
const IN_MEMORY_ROWS: &str = "seafowl_changeset_writer_in_memory_rows";
const IN_MEMORY_OLDEST: &str = "seafowl_changeset_writer_in_memory_oldest";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

_oldest_timestamp_seconds?

Comment thread src/frontend/flight/sync/metrics.rs Outdated
"The reduction in byte size due to batch compaction"
);
describe_counter!(
COMPACTED_BYTES,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
COMPACTED_BYTES,
COMPACTED_ROWS,

@gruuya
gruuya merged commit f07c74f into main Jun 21, 2024
@gruuya
gruuya deleted the sync-metrics branch June 21, 2024 06:02
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.

2 participants