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

fix(metrics): Expose Badger LSM and vlog size bytes. #7488

Merged
merged 1 commit into from
Mar 2, 2021
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
3 changes: 3 additions & 0 deletions dgraph/cmd/alpha/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ func TestMetrics(t *testing.T) {
"badger_v3_disk_reads_total", "badger_v3_disk_writes_total", "badger_v3_gets_total",
"badger_v3_memtable_gets_total", "badger_v3_puts_total", "badger_v3_read_bytes",
"badger_v3_written_bytes",
// The following metrics get exposed after 1 minute from Badger, so
// they're not available in time for this test
// "badger_v3_lsm_size_bytes", "badger_v3_vlog_size_bytes",

// Transaction Metrics
"dgraph_txn_aborts_total", "dgraph_txn_commits_total", "dgraph_txn_discards_total",
Expand Down
8 changes: 4 additions & 4 deletions x/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,13 +490,13 @@ func NewBadgerCollector() prometheus.Collector {
"Total number of memtable gets",
nil, nil,
),
"badger_v3_lsm_size": prometheus.NewDesc(
"badger_v3_lsm_size",
"badger_v3_lsm_size_bytes": prometheus.NewDesc(
"badger_v3_lsm_size_bytes",
"Size of the LSM in bytes",
[]string{"dir"}, nil,
),
"badger_v3_vlog_size": prometheus.NewDesc(
"badger_v3_vlog_size",
"badger_v3_vlog_size_bytes": prometheus.NewDesc(
"badger_v3_vlog_size_bytes",
"Size of the value log in bytes",
[]string{"dir"}, nil,
),
Expand Down