Skip to content

Commit

Permalink
fix: restore prometheus addr config (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-4chain authored Jun 26, 2024
1 parent 37ea4a5 commit 2d282bd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/arc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
}
Expand Down
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
1 change: 1 addition & 0 deletions config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ func getDefaultArcConfig() *ArcConfig {
LogFormat: "text",
ProfilerAddr: "", // optional
PrometheusEndpoint: "", // optional
PrometheusAddr: "", // optional
GrpcMessageSize: 100000000,
Network: "regtest",
QueueURL: "nats://nats:4222",
Expand Down
1 change: 1 addition & 0 deletions config/example_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2d282bd

Please sign in to comment.