diff --git a/cmd/arc/main.go b/cmd/arc/main.go index c4192d732..23a074da9 100644 --- a/cmd/arc/main.go +++ b/cmd/arc/main.go @@ -80,10 +80,10 @@ func run() error { }() go func() { - if arcConfig.PrometheusEndpoint != "" && arcConfig.ProfilerAddr != "" { + if arcConfig.PrometheusEndpoint != "" && arcConfig.PrometheusAddr != "" { logger.Info("Starting prometheus", slog.String("endpoint", arcConfig.PrometheusEndpoint)) http.Handle(arcConfig.PrometheusEndpoint, promhttp.Handler()) - err = http.ListenAndServe(arcConfig.ProfilerAddr, nil) + err = http.ListenAndServe(arcConfig.PrometheusAddr, nil) if err != nil { logger.Error("failed to start prometheus server", slog.String("err", err.Error())) } diff --git a/config/config.go b/config/config.go index 6ef058b8d..e15670d32 100644 --- a/config/config.go +++ b/config/config.go @@ -11,6 +11,7 @@ type ArcConfig struct { LogFormat string `mapstructure:"logFormat"` ProfilerAddr string `mapstructure:"profilerAddr"` PrometheusEndpoint string `mapstructure:"prometheusEndpoint"` + PrometheusAddr string `mapstructure:"prometheusAddr"` GrpcMessageSize int `mapstructure:"grpcMessageSize"` Network string `mapstructure:"network"` QueueURL string `mapstructure:"queueURL"` diff --git a/config/defaults.go b/config/defaults.go index a78320c70..f64013b9d 100644 --- a/config/defaults.go +++ b/config/defaults.go @@ -12,6 +12,7 @@ func getDefaultArcConfig() *ArcConfig { LogFormat: "text", ProfilerAddr: "", // optional PrometheusEndpoint: "", // optional + PrometheusAddr: "", // optional GrpcMessageSize: 100000000, Network: "regtest", QueueURL: "nats://nats:4222", diff --git a/config/example_config.yaml b/config/example_config.yaml index 394f31e74..47ca46009 100644 --- a/config/example_config.yaml +++ b/config/example_config.yaml @@ -3,6 +3,7 @@ logLevel: DEBUG # mode of logging. Value can be one of DEBUG | INFO | WARN | ERR logFormat: text # format of logging. Value can be one of text | json | tint profilerAddr: localhost:9999 # address to start profiler server on (optional) prometheusEndpoint: /metrics # endpoint for prometheus metrics (optional) +prometheusAddr: :2112 # port for serving prometheus metrics grpcMessageSize: 100000000 # maximum grpc message size network: regtest # bitcoin network to connect to. Value can be one of mainnet | testnet | regtest queueURL: nats://nats:4222 # URL for message queue