-
Notifications
You must be signed in to change notification settings - Fork 129
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(dot/babe) implement block production time metric #1648
Merged
EclesioMeloJunior
merged 16 commits into
development
from
eclesio/enhance-prometheus-metrics
Jun 24, 2021
Merged
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
fb36d45
metric: gossamer_proposer_block_constructed
EclesioMeloJunior ab635fd
Merge branch 'development' into eclesio/enhance-prometheus-metrics
EclesioMeloJunior 142039f
chore: improve metrics instance and add tests
EclesioMeloJunior 933f962
Merge branch 'eclesio/enhance-prometheus-metrics' of github.com:Chain…
EclesioMeloJunior 0f553b4
chore: add peer check and peerstore metrics
EclesioMeloJunior 8949754
chore: fix pacakge name and interface to gauge struct
EclesioMeloJunior d3a8f74
chore: change to const
EclesioMeloJunior 88368bf
chore: adjust babe metrics
EclesioMeloJunior 4599013
chore: removing duplicated net metrics
EclesioMeloJunior 5f592e1
chore: improve babe time to build block test
EclesioMeloJunior 2e1eb35
chore: fix CI tests failures
EclesioMeloJunior 14ef2d3
Merge branch 'development' into eclesio/enhance-prometheus-metrics
EclesioMeloJunior 691a47e
exec go mod tidy
EclesioMeloJunior b1037f8
Merge branch 'development' into eclesio/enhance-prometheus-metrics
EclesioMeloJunior 8152e3a
chore: go mod
EclesioMeloJunior 244f211
change docker-compose instructions to docs/ folder
EclesioMeloJunior File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: '3.7' | ||
|
||
services: | ||
noot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
prometheus: | ||
image: prom/prometheus | ||
volumes: | ||
- ./prometheus.yml:/etc/prometheus/prometheus.yml | ||
command: | ||
- '--config.file=/etc/prometheus/prometheus.yml' | ||
- '--storage.tsdb.path=/prometheus' | ||
- '--web.console.libraries=/usr/share/prometheus/console_libraries' | ||
- '--web.console.templates=/usr/share/prometheus/consoles' | ||
ports: | ||
- 9090:9090 | ||
restart: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ import ( | |
"fmt" | ||
"time" | ||
|
||
ethmetrics "github.com/ethereum/go-ethereum/metrics" | ||
badger "github.com/ipfs/go-ds-badger2" | ||
libp2phost "github.com/libp2p/go-libp2p-core/host" | ||
"github.com/libp2p/go-libp2p-core/peer" | ||
|
@@ -31,6 +32,11 @@ import ( | |
"github.com/libp2p/go-libp2p-kad-dht/dual" | ||
) | ||
|
||
const ( | ||
checkPeerCountMetrics = "gossamer/network/peer_count" | ||
peersStoreMetrics = "gossamer/network/peerstore_count" | ||
) | ||
|
||
var ( | ||
startDHTTimeout = time.Second * 10 | ||
initialAdvertisementTimeout = time.Millisecond | ||
|
@@ -115,6 +121,9 @@ func (d *discovery) stop() error { | |
return nil | ||
} | ||
|
||
ethmetrics.Unregister(checkPeerCountMetrics) | ||
ethmetrics.Unregister(peersStoreMetrics) | ||
Comment on lines
+124
to
+125
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does this do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this allows the unused metrics to be collected by the gc |
||
|
||
return d.dht.Close() | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great, but not sure if it's relevant to the contributing document, could you put it in
docs
somewhere?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!