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: tsm compaction metrics via prometheus #22904

Merged
merged 3 commits into from
Nov 19, 2021
Merged

feat: tsm compaction metrics via prometheus #22904

merged 3 commits into from
Nov 19, 2021

Conversation

lesam
Copy link
Contributor

@lesam lesam commented Nov 19, 2021

Closes #20025

@lesam
Copy link
Contributor Author

lesam commented Nov 19, 2021

Tested as working:

> curl localhost:8086/metrics | grep storage_compaction
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 29778    0 29778    0     0  28.3M      0 --:--:-- --:--:-- --:--:-- 28.3M
# HELP storage_compactions_active Gauge of compactions (by level) currently running
# TYPE storage_compactions_active gauge
storage_compactions_active{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="1",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6"} 0
# HELP storage_compactions_duration_seconds Histogram of compactions by level since startup
# TYPE storage_compactions_duration_seconds histogram
storage_compactions_duration_seconds_bucket{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="1",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6",le="0.1"} 0
storage_compactions_duration_seconds_bucket{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="1",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6",le="1"} 1
storage_compactions_duration_seconds_bucket{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="1",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6",le="10"} 1
storage_compactions_duration_seconds_bucket{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="1",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6",le="100"} 1
storage_compactions_duration_seconds_bucket{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="1",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6",le="1000"} 1
storage_compactions_duration_seconds_bucket{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="1",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6",le="10000"} 1
storage_compactions_duration_seconds_bucket{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="1",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6",le="100000"} 1
storage_compactions_duration_seconds_bucket{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="1",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6",le="+Inf"} 1
storage_compactions_duration_seconds_sum{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="1",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6"} 0.399322906
storage_compactions_duration_seconds_count{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="1",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6"} 1
storage_compactions_duration_seconds_bucket{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="cache",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6",le="0.1"} 0
storage_compactions_duration_seconds_bucket{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="cache",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6",le="1"} 8
storage_compactions_duration_seconds_bucket{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="cache",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6",le="10"} 8
storage_compactions_duration_seconds_bucket{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="cache",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6",le="100"} 8
storage_compactions_duration_seconds_bucket{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="cache",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6",le="1000"} 8
storage_compactions_duration_seconds_bucket{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="cache",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6",le="10000"} 8
storage_compactions_duration_seconds_bucket{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="cache",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6",le="100000"} 8
storage_compactions_duration_seconds_bucket{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="cache",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6",le="+Inf"} 8
storage_compactions_duration_seconds_sum{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="cache",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6"} 2.4615932029999996
storage_compactions_duration_seconds_count{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="cache",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6"} 8
# HELP storage_compactions_failed Counter of TSM compactions (by level) that have failed due to error
# TYPE storage_compactions_failed counter
storage_compactions_failed{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="1",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6"} 0
# HELP storage_compactions_queued Counter of TSM compactions (by level) that are currently queued
# TYPE storage_compactions_queued gauge
storage_compactions_queued{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="1",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6"} 0
storage_compactions_queued{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="2",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6"} 0
storage_compactions_queued{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="3",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6"} 0
storage_compactions_queued{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="full",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6"} 0
storage_compactions_queued{bucket="613e7d9a1e47191a",engine="tsm1",id="6",level="opt",path="/Users/sarnold/.influxdbv2/engine/data/613e7d9a1e47191a/autogen/6",walPath="/Users/sarnold/.influxdbv2/engine/wal/613e7d9a1e47191a/autogen/6"} 0

@lesam lesam requested a review from williamhbaker November 19, 2021 16:53
Copy link
Contributor

@williamhbaker williamhbaker left a comment

Choose a reason for hiding this comment

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

A couple of non-blocking questions; LGTM!

storage/engine.go Show resolved Hide resolved
tsdb/engine/tsm1/engine.go Outdated Show resolved Hide resolved
@lesam lesam merged commit dece95d into master Nov 19, 2021
@jacobmarble jacobmarble deleted the tsm-compaction branch January 2, 2024 22:53
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.

Port beta.8 Prometheus metrics for TSM compactions
2 participants