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(metrics): Add Badger metrics. #8034

Merged
merged 4 commits into from
Sep 21, 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: 2 additions & 1 deletion dgraph/cmd/alpha/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ func TestMetrics(t *testing.T) {
// Badger Metrics
"badger_disk_reads_total", "badger_disk_writes_total", "badger_gets_total",
"badger_memtable_gets_total", "badger_puts_total", "badger_read_bytes",
"badger_written_bytes",
"badger_written_bytes", "badger_blocked_puts_total",
"badger_compactions_current", "badger_pending_writes_total",
// The following metrics get exposed after 1 minute from Badger, so
// they're not available in time for this test
// "badger_lsm_size_bytes", "badger_vlog_size_bytes",
Expand Down
15 changes: 15 additions & 0 deletions x/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,11 @@ func NewBadgerCollector() prometheus.Collector {
"Total number of puts",
nil, nil,
),
"badger_v3_blocked_puts_total": prometheus.NewDesc(
"badger_blocked_puts_total",
"Total number of blocked puts",
nil, nil,
),
"badger_v3_memtable_gets_total": prometheus.NewDesc(
"badger_memtable_gets_total",
"Total number of memtable gets",
Expand All @@ -507,6 +512,16 @@ func NewBadgerCollector() prometheus.Collector {
"Size of the value log in bytes",
[]string{"dir"}, nil,
),
"badger_v3_pending_writes_total": prometheus.NewDesc(
"badger_pending_writes_total",
"Total number of pending writes",
[]string{"dir"}, nil,
),
"badger_v3_compactions_current": prometheus.NewDesc(
"badger_compactions_current",
"Number of tables being actively compacted",
nil, nil,
),
})
}

Expand Down