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

cmd/bootnode: enable prometheus #1534

Merged
merged 2 commits into from
Dec 9, 2022
Merged

cmd/bootnode: enable prometheus #1534

merged 2 commits into from
Dec 9, 2022

Conversation

corverroos
Copy link
Contributor

Enables prometheus metrics in the bootnode.

category: feature
ticket: #1506

@codecov
Copy link

codecov bot commented Dec 9, 2022

Codecov Report

Base: 54.37% // Head: 54.27% // Decreases project coverage by -0.10% ⚠️

Coverage data is based on head (da04a94) compared to base (cda80a5).
Patch coverage: 52.87% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1534      +/-   ##
==========================================
- Coverage   54.37%   54.27%   -0.11%     
==========================================
  Files         150      151       +1     
  Lines       19134    19144      +10     
==========================================
- Hits        10405    10390      -15     
- Misses       7319     7335      +16     
- Partials     1410     1419       +9     
Impacted Files Coverage Δ
cmd/bootnode.go 0.00% <0.00%> (ø)
cmd/bootnode/bootnode.go 55.00% <46.66%> (+16.71%) ⬆️
cmd/bootnode/p2p.go 65.78% <65.78%> (ø)
dkg/transport.go 53.70% <0.00%> (-12.97%) ⬇️
core/qbft/qbft.go 73.31% <0.00%> (-9.67%) ⬇️
app/app.go 63.73% <0.00%> (-0.74%) ⬇️
app/vmock.go 76.16% <0.00%> (+2.07%) ⬆️
core/priority/prioritiser.go 62.55% <0.00%> (+2.88%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

if err != nil {
p2pErr <- errors.Wrap(err, "new tcp node")
// Start serving HTTP: ENR and monitoring.
serverErr := make(chan error, 2)
Copy link
Contributor

Choose a reason for hiding this comment

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

why "2"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

2 servers

)
if config.HTTPAddr != "" {
log.Info(ctx, "Runtime ENR available via http",
z.Str("url", fmt.Sprintf("http://%s/enr", config.HTTPAddr)),
Copy link
Contributor

@dB2510 dB2510 Dec 9, 2022

Choose a reason for hiding this comment

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

config.HTTPAddr can be something like this http://abc.xyz, this should be
fmt.Sprintf("%s/enr", config.HTTPAddr) i think

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 shouldn't be:

	flags.StringVar(&config.HTTPAddr, "bootnode-http-address", "127.0.0.1:3640", "Listening address (ip and port) for the bootnode http server serving runtime ENR.")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can add a ticket to do validation of all listen address flags in the repo if you want.

Comment on lines +41 to +44
limiter := rcmgr.DefaultLimits
limiter.SystemBaseLimit.ConnsInbound = config.MaxConns
limiter.SystemBaseLimit.FD = config.MaxConns
limiter.TransientBaseLimit = limiter.SystemBaseLimit
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: add a comment for each of these limits

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just moved this. You are are welcome to add the comments if you want.

flags.BoolVar(&config.P2PRelay, "p2p-relay", true, "Enable libp2p tcp host providing circuit relay to charon clusters")
flags.StringVar(&config.RelayLogLevel, "p2p-relay-loglevel", "", "Libp2p circuit relay log level. E.g., debug, info, warn, error")
flags.StringVar(&config.HTTPAddr, "bootnode-http-address", "127.0.0.1:3640", "Listening address (ip and port) for the bootnode http server serving runtime ENR.")
flags.StringVar(&config.MonitoringAddr, "bootnode-monitoring-address", "127.0.0.1:3620", "Listening address (ip and port) for the prometheus and pprof monitoring http server.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
flags.StringVar(&config.MonitoringAddr, "bootnode-monitoring-address", "127.0.0.1:3620", "Listening address (ip and port) for the prometheus and pprof monitoring http server.")
flags.StringVar(&config.MonitoringAddr, "bootnode-monitoring-address", "127.0.0.1:3620", "Listening address (ip and port) for the prometheus and pprof monitoring http server for bootnode")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

bit redundant?

@corverroos corverroos added the merge when ready Indicates bulldozer bot may merge when all checks pass label Dec 9, 2022
@obol-bulldozer obol-bulldozer bot merged commit ad252c1 into main Dec 9, 2022
@obol-bulldozer obol-bulldozer bot deleted the corver/bootnodeprom branch December 9, 2022 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants