-
Notifications
You must be signed in to change notification settings - Fork 111
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): Monitor and publish metrics to Prometheus. #1437
Conversation
@RyRy79261 you can omit the |
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.
great work, it works for me!
INFO[03-05|09:49:28] Enabling stand-alone metrics HTTP endpoint address=127.0.0.1:7012 caller=node.go:297
INFO[03-05|09:49:28] Starting metrics server addr=http://127.0.0.1:7012/metrics caller=node.go:308
$ curl http://127.0.0.1:7012/metrics
# TYPE network_node_latency gauge
network_node_latency 0
# TYPE network_node_peerCount gauge
network_node_peerCount 0
# TYPE network_node_totalConnection gauge
network_node_totalConnection 0
# TYPE service_blocks_sync gauge
service_blocks_sync 0
# TYPE system_cpu_goroutines gauge
system_cpu_goroutines 82
# TYPE system_cpu_procload gauge
system_cpu_procload 125
# TYPE system_cpu_sysload gauge
system_cpu_sysload 201
# TYPE system_cpu_syswait gauge
system_cpu_syswait 0
# TYPE system_memory_allocs gauge
system_memory_allocs 241501003
# TYPE system_memory_frees gauge
system_memory_frees 238847505
# TYPE system_memory_held gauge
system_memory_held 467861504
# TYPE system_memory_pauses gauge
system_memory_pauses 8204387
# TYPE system_memory_used gauge
system_memory_used 371083400
could you add a --metrics-port
flag that specifies what port the prometheus server should run on?
Updated with metrics port flag. |
@@ -238,10 +240,37 @@ func (s *Service) Start() error { | |||
|
|||
logger.Info("started network service", "supported protocols", s.host.protocols()) | |||
|
|||
if s.cfg.PublishMetrics { |
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.
maybe I missed it but I don't see this being set anywhere? eg in dot/services.go
createNetworkService
?
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.
Thanks for pointing it. I missed it while refactoring the metrics package.
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.
looks good! please double check that network config PublishMetrics
is being set
Arijit Das: feat(metrics): Monitor and publish metrics to Prometheus. (#1437) * Monitor and publish metrics to prometheus. * Add flags for metrics server port.
Changes
Tests
Checklist
Issues