Skip to content

Commit

Permalink
[monitoring] Change metric ports (#53)
Browse files Browse the repository at this point in the history
Signed-off-by: v.oleynikov <[email protected]>
  • Loading branch information
duckhawk authored May 22, 2024
1 parent 80cd81e commit 578a6ec
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion images/agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

`NODE_NAME`

`METRICS_PORT` - default : 8080
`METRICS_PORT` - default : 9695


#### Metrics
Expand Down
7 changes: 4 additions & 3 deletions images/agent/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"sds-node-configurator/pkg/kubutils"
"sds-node-configurator/pkg/logger"
"sds-node-configurator/pkg/monitoring"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"

v1 "k8s.io/api/core/v1"
sv1 "k8s.io/api/storage/v1"
Expand Down Expand Up @@ -89,9 +90,9 @@ func main() {
log.Info("[main] successfully read scheme CR")

managerOpts := manager.Options{
Scheme: scheme,
//MetricsBindAddress: cfgParams.MetricsPort,
Logger: log.GetLogger(),
Scheme: scheme,
Logger: log.GetLogger(),
Metrics: server.Options{BindAddress: cfgParams.MetricsPort},
}

mgr, err := manager.New(kConfig, managerOpts)
Expand Down
2 changes: 1 addition & 1 deletion images/agent/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func NewConfig() (*Options, error) {

opts.MetricsPort = os.Getenv(MetricsPort)
if opts.MetricsPort == "" {
opts.MetricsPort = ":8080"
opts.MetricsPort = ":9695"
}

scanInt := os.Getenv(ScanInterval)
Expand Down
2 changes: 1 addition & 1 deletion images/agent/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func TestNewConfig(t *testing.T) {

t.Run("MetricsPortNotSet_ReturnsDefaultPort", func(t *testing.T) {
expNodeName := "test-node"
expMetricsPort := ":8080"
expMetricsPort := ":9695"
expMachineId := "test-id"

err := os.Setenv(NodeName, expNodeName)
Expand Down

0 comments on commit 578a6ec

Please sign in to comment.