From fd08649cb9cbe6f1fcfedd9d0d70062f2429c5f6 Mon Sep 17 00:00:00 2001 From: iknite Date: Mon, 4 Feb 2019 14:00:11 +0100 Subject: [PATCH] Refactor port for metrics-addr 9990->8600 --- cmd/start.go | 4 ++-- config.example.yml | 2 +- deploy/aws/main.tf | 6 +++--- server/config.go | 2 +- server/server.go | 2 +- tests/e2e/server_test.go | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/start.go b/cmd/start.go index 7ad3d87d5..8758a09d6 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -86,7 +86,7 @@ func newStartCommand(ctx *cmdContext) *cobra.Command { hostname, _ := os.Hostname() f.StringVar(&conf.NodeID, "node-id", hostname, "Unique name for node. If not set, fallback to hostname") f.BoolVarP(&conf.EnableProfiling, "profiling", "f", false, "Allow a pprof url (localhost:6060) for profiling purposes") - f.BoolVarP(&conf.EnableMetrics, "metrics", "m", false, "Allow export metrics through --metrics-addr (default localhost:9990)") + f.BoolVarP(&conf.EnableMetrics, "metrics", "m", false, "Allow export metrics through --metrics-addr (default localhost:8600)") f.StringVar(&conf.PrivateKeyPath, "keypath", fmt.Sprintf("%s/%s", ctx.path, "id_ed25519"), "Server Singning private key file path") f.StringVar(&conf.SSLCertificate, "certificate", fmt.Sprintf("%s/%s", ctx.path, "server.crt"), "Server crt file") f.StringVar(&conf.SSLCertificateKey, "certificate-key", fmt.Sprintf("%s/%s", ctx.path, "server.key"), "Server key file") @@ -94,7 +94,7 @@ func newStartCommand(ctx *cmdContext) *cobra.Command { f.StringVar(&conf.HTTPAddr, "http-addr", ":8800", "Endpoint for REST requests on (host:port)") f.StringVar(&conf.RaftAddr, "raft-addr", ":9000", "Raft bind address (host:port)") f.StringVar(&conf.MgmtAddr, "mgmt-addr", ":8700", "Management endpoint bind address (host:port)") - f.StringVar(&conf.MgmtAddr, "metrics-addr", ":9990", "Metrics export bind address (host:port)") + f.StringVar(&conf.MgmtAddr, "metrics-addr", ":8600", "Metrics export bind address (host:port)") f.StringSliceVar(&conf.RaftJoinAddr, "join-addr", []string{}, "Raft: Comma-delimited list of nodes ([host]:port), through which a cluster can be joined") f.StringVar(&conf.GossipAddr, "gossip-addr", ":9100", "Gossip: management endpoint bind address (host:port)") f.StringSliceVar(&conf.GossipJoinAddr, "gossip-join-addr", []string{}, "Gossip: Comma-delimited list of nodes ([host]:port), through which a cluster can be joined") diff --git a/config.example.yml b/config.example.yml index 821af8539..485058341 100644 --- a/config.example.yml +++ b/config.example.yml @@ -37,7 +37,7 @@ server: addr: http: ":8800" # Endpoint for REST requests on (host:port). mgmt: ":8700" # Management endpoint bind address (host:port). - metrics: ":9990" # Metrics endpoint (host:port). where raft node can join the current cluster + metrics: ":8600" # Metrics endpoint (host:port). where raft node can join the current cluster raft: ":9000" # Raft bind address (host:port). internal message passing raft_join: # Raft: list of nodes ([host]:port), where the node can join the cluster using the mgmt endpoint - "127.0.0.1:8700" diff --git a/deploy/aws/main.tf b/deploy/aws/main.tf index fabd06cf0..fffe4eb2d 100644 --- a/deploy/aws/main.tf +++ b/deploy/aws/main.tf @@ -227,7 +227,7 @@ module "prometheus" { - job_name: 'Qed-00-Service' scrape_interval: 10s static_configs: - - targets: ['${module.leader.private_ip}:9990'] + - targets: ['${module.leader.private_ip}:8600'] - job_name: 'Qed-01-Host' scrape_interval: 10s static_configs: @@ -235,7 +235,7 @@ module "prometheus" { - job_name: 'Qed-01-Service' scrape_interval: 10s static_configs: - - targets: ['${module.follower-1.private_ip}:9990'] + - targets: ['${module.follower-1.private_ip}:8600'] - job_name: 'Qed-02-Host' scrape_interval: 10s static_configs: @@ -243,6 +243,6 @@ module "prometheus" { - job_name: 'Qed-02-Service' scrape_interval: 10s static_configs: - - targets: ['${module.follower-2.private_ip}:9990'] + - targets: ['${module.follower-2.private_ip}:8600'] CONFIG } diff --git a/server/config.go b/server/config.go index edd0db487..2b7044f14 100644 --- a/server/config.go +++ b/server/config.go @@ -91,7 +91,7 @@ func DefaultConfig() *Config { HTTPAddr: "127.0.0.1:8800", RaftAddr: "127.0.0.1:9000", MgmtAddr: "127.0.0.1:8700", - MetricsAddr: "127.0.0.1:9990", + MetricsAddr: "127.0.0.1:8600", RaftJoinAddr: []string{}, GossipAddr: "127.0.0.1:9100", GossipJoinAddr: []string{}, diff --git a/server/server.go b/server/server.go index 419e8d8f8..3977eca0d 100644 --- a/server/server.go +++ b/server/server.go @@ -211,7 +211,7 @@ func (s *Server) Start() error { if s.conf.EnableMetrics { go func() { - log.Debugf(" * Starting metrics HTTP server in addr: localhost:9990") + log.Debugf(" * Starting metrics HTTP server in addr: %s", s.conf.MetricsAddr) if err := s.metricsServer.ListenAndServe(); err != http.ErrServerClosed { log.Errorf("Can't start metrics HTTP server: %s", err) } diff --git a/tests/e2e/server_test.go b/tests/e2e/server_test.go index a63e85cf2..79f0cd56f 100644 --- a/tests/e2e/server_test.go +++ b/tests/e2e/server_test.go @@ -27,7 +27,7 @@ import ( const ( QEDProfilingURL = "http://localhost:6060/debug/pprof" - QEDMetricsURL = "http://localhost:9990/metrics" + QEDMetricsURL = "http://localhost:8600/metrics" ) // FIXME: This function should also include testing for the other servers, not