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

Add Badger expvar metrics to Prometheus metrics. #5094

Merged
merged 6 commits into from
Apr 23, 2020

Conversation

danielmai
Copy link
Contributor

@danielmai danielmai commented Apr 3, 2020

What does this PR do?

This adds the following badger metrics into /debug/prometheus_metrics:

  • badger_v2_disk_reads_total
  • badger_v2_disk_writes_total
  • badger_v2_gets_total
  • badger_v2_lsm_bloom_hits_total (per level)
  • badger_v2_lsm_level_gets_total (per level)
  • badger_v2_memtable_gets_total
  • badger_v2_puts_total
  • badger_v2_read_bytes
  • badger_v2_written_bytes

Changes:

  • This is added via the Prometheus expvar collector.
  • Update metrics_test.go for the seven initial Badger versions (excluding the LSM metrics).

Motivation

For #4772.

Components affected by this PR

This adds to the exposed Prometheus metrics. These metrics were already accessible via /debug/vars.

Does this PR break backwards compatibility?

No.

Fixes

#4772

More

The LSM metrics don't show up immediately. They show up after there are hits/gets to the LSM tree.


This change is Reviewable

Docs Preview: Dgraph Preview

@danielmai danielmai requested review from manishrjain and a team as code owners April 3, 2020 16:39
@danielmai danielmai changed the title Danielmai/badger metrics Add Badger expvar metrics to Prometheus metrics. Apr 3, 2020
Copy link
Contributor

@martinmr martinmr left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @manishrjain)

Copy link
Contributor

@prashant-shahi prashant-shahi left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @manishrjain)

Copy link
Contributor

@jarifibrahim jarifibrahim left a comment

Choose a reason for hiding this comment

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

We've renamed the metrics in badger and PR #5216 updates badger in dgraph. The metric names will have to be updated once PR #5216 is merged.

Reviewable status: 1 of 2 files reviewed, all discussions resolved (waiting on @manishrjain, @martinmr, and @prashant-shahi)

Ibrahim Jarif and others added 3 commits April 22, 2020 20:57
@danielmai danielmai merged commit e15ace6 into master Apr 23, 2020
@danielmai danielmai deleted the danielmai/badger-metrics branch April 23, 2020 20:16
danielmai added a commit that referenced this pull request Apr 24, 2020
Fixes #4772 

This adds the following badger metrics into /debug/prometheus_metrics:

badger_v2_disk_reads_total
badger_v2_disk_writes_total
badger_v2_gets_total
badger_v2_lsm_bloom_hits_total (per level)
badger_v2_lsm_level_gets_total (per level)
badger_v2_memtable_gets_total
badger_v2_puts_total
badger_v2_read_bytes
badger_v2_written_bytes

This is added via the Prometheus expvar collector.
Update metrics_test.go for the seven initial Badger versions (excluding the LSM metrics).

This adds to the exposed Prometheus metrics. These metrics were already accessible via /debug/vars.

The LSM metrics don't show up immediately. They show up after there are hits/gets to the LSM tree.

Changes
* Add Badger metrics to Prometheus
* Update metrics test to check for badger metrics.

Co-authored-by: Ibrahim Jarif <[email protected]>
danielmai added a commit that referenced this pull request Apr 24, 2020
Fixes #4772 

This adds the following badger metrics into /debug/prometheus_metrics:

badger_v2_disk_reads_total
badger_v2_disk_writes_total
badger_v2_gets_total
badger_v2_lsm_bloom_hits_total (per level)
badger_v2_lsm_level_gets_total (per level)
badger_v2_memtable_gets_total
badger_v2_puts_total
badger_v2_read_bytes
badger_v2_written_bytes

This is added via the Prometheus expvar collector.
Update metrics_test.go for the seven initial Badger versions (excluding the LSM metrics).

This adds to the exposed Prometheus metrics. These metrics were already accessible via /debug/vars.

The LSM metrics don't show up immediately. They show up after there are hits/gets to the LSM tree.

Changes
* Add Badger metrics to Prometheus
* Update metrics test to check for badger metrics.

Co-authored-by: Ibrahim Jarif <[email protected]>
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 18, 2020
Fixes hypermodeinc#4772 

This adds the following badger metrics into /debug/prometheus_metrics:

badger_v2_disk_reads_total
badger_v2_disk_writes_total
badger_v2_gets_total
badger_v2_lsm_bloom_hits_total (per level)
badger_v2_lsm_level_gets_total (per level)
badger_v2_memtable_gets_total
badger_v2_puts_total
badger_v2_read_bytes
badger_v2_written_bytes

This is added via the Prometheus expvar collector.
Update metrics_test.go for the seven initial Badger versions (excluding the LSM metrics).

This adds to the exposed Prometheus metrics. These metrics were already accessible via /debug/vars.

The LSM metrics don't show up immediately. They show up after there are hits/gets to the LSM tree.

Changes
* Add Badger metrics to Prometheus
* Update metrics test to check for badger metrics.

Co-authored-by: Ibrahim Jarif <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants