Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


Motivation

Currently Paimon runs without monitoring and metrics out of box. In the production environment, users need to know how their Paimon Table behaves like what is the commit duration, how many files each commit added or deleted, the status of compaction operation, the duration of scan query, lag of streaming reading and so on. So we need to introduce a metrics system and more metrics for Paimon.  

...

draw.io Diagram
bordertrue
diagramNameMetricsSystem
simpleViewerfalse
width
linksauto
tbstyletop
lboxtrue
diagramWidth1141
revision56

Metrics Registering

Take CommitMetrics as example, the CommitMetrics will be instantiated by FileStoreCommitImpl, then commit related metrics will be registered by the corresponding MetricGroup in the Metrics instance

...

Metric Name

Description

Type

Tagged

Unit

Update at

lastCommitDuration

The time it took to complete the last commit.

Gauge

none

Ms

Timer starts before commit starting, update commit duration after the last commit finished.

commitDuration

Distributions of the time taken by the last few commits.

Histogram

none

Ms

Timer starts before commit starting, update commit duration after each commit finished.

lastCommitAttempts

The number of attempts the last commit made.

Gauge

none

Number

Increment by 1 when trying to commit once, clear the counter after the last commit finished.

lastTableFilesAdded

Number of added table files in last commit, including newly created data files and compacted after.

Gauge

Partition, Bucketnone

Number

Collecting changes from committables

lastTableFilesDeleted

Number of deleted table files in last commit, which comes from compacted before.

Gauge

Partition, Bucketnone

Number

Collecting changes from committables

lastTableFilesAppended

Number of appended table files in last commit, which means the newly created data files.

Gauge

Partition, Bucketnone

Number

Collecting changes from committables

lastTableFilesCommitCompated

Number of compacted table files in last commit, including compacted before and after.

Gauge

Partition, Bucketnone

Number

Collecting changes from committables

lastChangelogFilesAppended

Number of appended changelog files in last commit

Gauge

Partition, Bucketnone

Number

Collecting changes from committables

lastChangelogFileCommitCompacted

Number of compacted changelog files in last commit

Gauge

Partition, Bucketnone

Number

Collecting changes from committables

totalTablesFileslastGeneratedSnapshots

Number of total data files currently maintained on storage.snapshot files generated in last commit, maybe 1 snapshot or 2 snapshots.

GaugeCounter

none

Number

Collecting After collecting changes from committables

totalChangelogFiles

Number of total changelog files currently maintained on storage.

Counter

none

Number

Collecting changes from committables

lastGeneratedSnapshots

Number of snapshot files generated in last commit, maybe 1 snapshot or 2 snapshots.

Gauge

none

Number

After collecting changes from committables

totalSnapshots

Number of currently retained total snapshots.

Gauge

none

Number

When trying to commit, the counter will increment by the number of snapshots generated

When expiring snapshots, the counter will decrement by the number of expiring snapshots.

lastDeltaRecordsAppended

Delta records count

lastDeltaRecordsAppended

Delta records count in last commit with APPEND commit kind

Gauge

Partition, Bucketnone

Number

Preparing snapshot file with APPEND commit kind

lastChangelogRecordsAppended

Changelog records count in last commit with APPEND commit kind

Gauge

Partition, Bucketnone

Number

Preparing snapshot file with APPEND commit kind

lastDeltaRecordsCommitCompated

Delta records count in last commit with COMPACT commit kind

Gauge

Partition, Bucketnone

Number

Preparing snapshot file with COMPACT commit kind

lastChangelogRecordsCommitCompated

Changelog records count in last commit with COMPACT commit kind

Gauge

Partition, Bucketnone

Number

Preparing snapshot file with COMPACT commit kind

lastPartitionsWritten

Number of partitions written in last commit

Gauge

none

Number

After collecting changes from committables

lastBucketsWritten

Number of buckets written in last commit

Gauge

none

Number

After collecting changes from committables

...

Metric Name

Description

Type

Tagged

Unit

Update at

lastScanDuration

The time it took to complete the last scan planning.

Gauge

Partition, Bucketnone

Ms

Timer starts before the scan planning starts, update after the last scan planning operation finished

scanDuration

Distributions of the time taken by the last few scan planning operations.

Histogram

Partition, Bucketnone

Ms

Timer starts before the scan planning starts, update after each planning finished

lastScannedManifests

Number of scanned manifests files in the last scan planning.

Gauge

Partition, Bucketnone

Number

Scan planning

lastScanSkippedManifests

Number of skipped manifests files in the last scan planning.

Gauge

Partition, Bucket

Number

Scan planning

lastScanResultTableFiles

Number of result table manifests files in the last scan planning.

Gauge

Partition, Bucketnone

Number

Scan planning

lastScanGenerateSplitslastScanResultTableFiles

Number of splits generated by result table files in the last scan planning.

Gauge

Partition, Bucketnone

Number

Scan planning

CompactionMetrics

...

Metric Name

Description

Type

Tagged

Unit

Update at

lastCompactionDuration

The time it took to complete the last compaction.

Gauge

Partition, Bucketnone

Ms

Timer starts before compaction, update after the last compaction finished

compactionDuration

Distributions of the time taken by the last few compactions.

Histogram

Partition, Bucketnone

Ms

Timer starts before compaction, update after each compaction finished

lastTableFilesCompactedBefore

Number of deleted files in last compaction

Gauge

Partition, Bucketnone

Number

After getting compaction result.

lastTableFilesCompactedAfter

Number of added files in last compaction

Gauge

Partition, Bucketnone

Number

After getting compaction result.

lastChangelogFilesCompacted

Number of changelog files compacted in last compaction

Gauge

Partition, Bucketnone

Number

After getting compaction result.

lastSortedRunslastCompactOutputLevel

Number of total sorted runs of all levels at last compaction

Gauge

Partition, Bucketnone

Number

Updating levels after getting compaction result.

lastLevel0FileslastCompactFileSize

Number of files at level 0 at Sum of file size compacted in last compaction

Gauge

Partition, Bucketnone

Number

Updating levels after getting compaction result.

...