Skip to content
Snippets Groups Projects
Unverified Commit ae8c78f1 authored by Levente Pap's avatar Levente Pap
Browse files

Fix metrics config + enable prometheus collection on entry_node

parent e68d3f27
No related branches found
No related tags found
No related merge requests found
package prometheus
import (
"github.com/iotaledger/goshimmer/plugins/config"
"github.com/iotaledger/goshimmer/plugins/metrics"
)
func init() {
if config.Node.GetBool(metrics.CfgMetricsLocal) {
registerAutopeeringMetrics()
registerDataMetrics()
registerFPCMetrics()
registerInfoMetrics()
registerNetworkMetrics()
registerProcessMetrics()
registerTangleMetrics()
}
if config.Node.GetBool(metrics.CfgMetricsGlobal) {
registerClientsMetrics()
}
}
......@@ -8,6 +8,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/iotaledger/goshimmer/packages/shutdown"
"github.com/iotaledger/goshimmer/plugins/config"
"github.com/iotaledger/goshimmer/plugins/metrics"
"github.com/iotaledger/hive.go/daemon"
"github.com/iotaledger/hive.go/logger"
"github.com/iotaledger/hive.go/node"
......@@ -34,6 +35,20 @@ func configure(plugin *node.Plugin) {
if config.Node.GetBool(CfgPrometheusProcessMetrics) {
registry.MustRegister(prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}))
}
if config.Node.GetBool(metrics.CfgMetricsLocal) {
registerAutopeeringMetrics()
registerDataMetrics()
registerFPCMetrics()
registerInfoMetrics()
registerNetworkMetrics()
registerProcessMetrics()
registerTangleMetrics()
}
if config.Node.GetBool(metrics.CfgMetricsGlobal) {
registerClientsMetrics()
}
}
func addCollect(collect func()) {
......
......@@ -22,16 +22,18 @@ services:
--autopeering.entryNodes=
--analysis.server.bindAddress=0.0.0.0:1888
--analysis.dashboard.bindAddress=0.0.0.0:9000
--node.enablePlugins=analysis-server,analysis-dashboard
--node.enablePlugins=analysis-server,analysis-dashboard,prometheus
--analysis.dashboard.dev=false
--metrics.local=false
--metrics.global=true
--prometheus.bindAddress=0.0.0.0:9312
--node.disablePlugins=portcheck,dashboard,analysis-client,gossip,drng,issuer,sync,messagelayer,valuetransfers,webapi,webapibroadcastdataendpoint,webapifindtransactionhashesendpoint,webapigetneighborsendpoint,webapigettransactionobjectsbyhashendpoint,webapigettransactiontrytesbyhashendpoint
volumes:
- ./config.docker.json:/tmp/config.json:ro
- goshimmer-cache:/go
ports:
- "127.0.0.1:9000:9000/tcp" # analysis dashboard
- "127.0.0.1:9312:9312/tcp" # prometheus
expose:
- "1888/tcp" # analysis server (within Docker network)
......
......@@ -3,4 +3,5 @@ scrape_configs:
scrape_interval: 5s
static_configs:
- targets:
- peer_master:9311
\ No newline at end of file
- peer_master:9311
- entry_node:9312
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment