Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,13 @@ public class MetricNames {
// metrics for table bucket
// --------------------------------------------------------------------------------------------

// for tablet
public static final String LAKE_PENDING_RECORDS = "pendingRecords";

// for log tablet
public static final String LOG_NUM_SEGMENTS = "numSegments";
public static final String LOG_END_OFFSET = "endOffset";
public static final String REMOTE_LOG_SIZE = "size";
public static final String LOG_LAKE_PENDING_RECORDS = "pendingRecords";
public static final String LOG_LAKE_TIMESTAMP_LAG = "timestampLag";

// for logic storage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.fluss.config.TableConfig;
import org.apache.fluss.exception.FencedLeaderEpochException;
import org.apache.fluss.exception.InvalidColumnProjectionException;
import org.apache.fluss.exception.InvalidTableException;
import org.apache.fluss.exception.InvalidTimestampException;
import org.apache.fluss.exception.InvalidUpdateVersionException;
import org.apache.fluss.exception.KvStorageException;
Expand Down Expand Up @@ -549,11 +550,20 @@ private void onBecomeNewLeader() {
private void registerLakeTieringMetrics() {
lakeTieringMetricGroup = bucketMetricGroup.addGroup("lakeTiering");
lakeTieringMetricGroup.gauge(
MetricNames.LOG_LAKE_PENDING_RECORDS,
() ->
getLakeLogEndOffset() < 0L
? getLogHighWatermark() - getLogStartOffset()
: getLogHighWatermark() - getLakeLogEndOffset());
MetricNames.LAKE_PENDING_RECORDS,
() -> {
long lakeLogEndOffset = getLakeLogEndOffset();
if (lakeLogEndOffset < 0L) {
try {
return getRowCount();
} catch (InvalidTableException e) {
// WAL mode or v0.9 old table with no completed tiering:
// row count disabled, return -1 to indicate unavailable
return -1L;
}
}
return getLogHighWatermark() - lakeLogEndOffset;
});
lakeTieringMetricGroup.gauge(
MetricNames.LOG_LAKE_TIMESTAMP_LAG,
() ->
Expand Down
4 changes: 2 additions & 2 deletions website/docs/maintenance/observability/monitor-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -850,12 +850,12 @@ Some metrics might not be exposed when using other JVM implementations (e.g. IBM
<tr>
<td rowspan="2">table_bucket_lakeTiering</td>
<td>pendingRecords</td>
<td>The number of records lag between local log and remote log for this table bucket.</td>
<td>The number of records lag between the latest log record and the latest tiered lake log record for this table bucket. Returns -1 if row count is disabled (WAL mode or v0.9 old table) and no tiering has completed.</td>
<td>Gauge</td>
</tr>
<tr>
<td>timestampLag</td>
<td>The timestamp lag between local log and remote log for this table bucket in milliseconds.</td>
<td>The timestamp lag between the latest log record and the latest tiered lake log record for this table bucket, in milliseconds.</td>
<td>Gauge</td>
</tr>
<tr>
Expand Down