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 Metrics to Bootnode #5460

Merged
merged 37 commits into from
Apr 20, 2020
Merged

Add Metrics to Bootnode #5460

merged 37 commits into from
Apr 20, 2020

Conversation

rauljordan
Copy link
Contributor

Resolves #4217


Description

Write a summary of the changes you are making

Adds kaddht peer count + discv5 peer count to the prometheus metrics of a bootnode.

@rauljordan rauljordan requested a review from a team as a code owner April 16, 2020 20:08
@rauljordan rauljordan self-assigned this Apr 16, 2020
@rauljordan rauljordan added Enhancement New feature or request Ready For Review A pull request ready for code review labels Apr 16, 2020
terencechain
terencechain previously approved these changes Apr 16, 2020
Name: "bootstrap_node_kaddht_peers",
Help: "The current number of kaddht peers of the bootstrap node",
})
discv5PeersCount = promauto.NewGauge(prometheus.GaugeOpts{
Copy link
Member

Choose a reason for hiding this comment

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

Want to use NewGaugeFunc?

https://godoc.org/github.com/prometheus/client_golang/prometheus#NewGaugeFunc

With that, you could remove that RunEvery routine and prometheus would simply run the function when the metrics page is scraped

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would end up being more code added cause I would have to call update metrics twice for each of them in the callback, also I wouldn't be able to initialize it at the top as a package var

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, i was afraid of that

prestonvanloon
prestonvanloon previously approved these changes Apr 16, 2020
Copy link
Member

@prestonvanloon prestonvanloon left a comment

Choose a reason for hiding this comment

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

LGTM, I had one comment, but I don't feel very strongly about it.

@nisdas
Copy link
Member

nisdas commented Apr 18, 2020

this is failing build @rauljordan . You need to update your docker deps too

@nisdas
Copy link
Member

nisdas commented Apr 18, 2020

build still fails @rauljordan

/root/.cache/bazel/_bazel_root/5c04516d923b21f838ef18b7f8ed7f88/execroot/prysm/tools/bootnode/bootnode.go:131:27: undefined: dht
 

nisdas
nisdas previously approved these changes Apr 18, 2020
@prestonvanloon
Copy link
Member

Build fails

@codecov
Copy link

codecov bot commented Apr 20, 2020

Codecov Report

Merging #5460 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #5460   +/-   ##
=======================================
  Coverage   14.88%   14.88%           
=======================================
  Files           8        8           
  Lines         430      430           
=======================================
  Hits           64       64           
  Misses        351      351           
  Partials       15       15           

@prylabs-bulldozer prylabs-bulldozer bot merged commit 61c96f5 into master Apr 20, 2020
@delete-merged-branch delete-merged-branch bot deleted the bootnode-metrics branch April 20, 2020 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add metrics to bootnode
4 participants