Skip to content

Commit 89e5d20

Browse files
Reasonable-Solutionssindrerh2ybelMekk
committed
🔪 superflous metrics
these are handled by the histogram Co-Authored-By: sindrerh2 <[email protected]> Co-Authored-By: Youssef Bel Mekki <[email protected]>
1 parent acc7533 commit 89e5d20

20 files changed

+0
-22
lines changed

cmd/aivencmd/createcmd.go

-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ func createCommand() *cli.Command {
8080
},
8181
},
8282
Before: func(context *cli.Context) error {
83-
metrics.AddOne("aiven_create_total")
8483
if context.Args().Len() < 3 {
8584
metrics.AddOne("aiven_create_required_args_error_total")
8685
return fmt.Errorf("missing required arguments: service, username, namespace")

cmd/aivencmd/getcmd.go

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ func getCommand() *cli.Command {
1616
Usage: "Generate preferred config format to '/tmp' folder",
1717
ArgsUsage: "service username namespace",
1818
Before: func(context *cli.Context) error {
19-
metrics.AddOne("aiven_get_total")
2019
if context.Args().Len() < 3 {
2120
metrics.AddOne("aiven_get_arguments_error_total")
2221

cmd/aivencmd/tidycmd.go

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ func tidyCommand() *cli.Command {
1313
Description: `Remove '/tmp' folder '$TMPDIR' and files created by the aiven command
1414
Caution - This will delete all files in '/tmp' folder starting with 'aiven-secret-'`,
1515
Action: func(context *cli.Context) error {
16-
metrics.AddOne("aiven_tidy_total")
1716
return aiven.TidyLocalSecrets()
1817
},
1918
}

cmd/devicecmd/configcmd.go

-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ func getConfigCommand() *cli.Command {
2929
Name: "get",
3030
Usage: "Gets the current configuration",
3131
Action: func(context *cli.Context) error {
32-
metrics.AddOne("device_config_get_total")
3332
config, err := naisdevice.GetConfiguration(context.Context)
3433
if err != nil {
3534
return err
@@ -48,7 +47,6 @@ func setConfigCommand() *cli.Command {
4847
Usage: "Sets a configuration value",
4948
ArgsUsage: "setting value",
5049
Before: func(context *cli.Context) error {
51-
metrics.AddOne("device_config_set_total")
5250
if context.Args().Len() < 2 {
5351
metrics.AddOne("device_settings_error_total")
5452
return fmt.Errorf("missing required arguments: setting, value")

cmd/devicecmd/connectioncmd.go

-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ func connectCommand() *cli.Command {
1111
Name: "connect",
1212
Usage: "Creates a naisdevice connection, will lock until connection",
1313
Action: func(context *cli.Context) error {
14-
metrics.AddOne("device_connect_total")
1514
return naisdevice.Connect(context.Context)
1615
},
1716
}
@@ -22,7 +21,6 @@ func disconnectCommand() *cli.Command {
2221
Name: "disconnect",
2322
Usage: "Disconnects your naisdevice",
2423
Action: func(context *cli.Context) error {
25-
metrics.AddOne("device_disconnect_total")
2624
return naisdevice.Disconnect(context.Context)
2725
},
2826
}

cmd/devicecmd/doctor.go

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ func doctorCommand() *cli.Command {
1515
Name: "doctor",
1616
Usage: "Examine the health of your naisdevice",
1717
Action: func(context *cli.Context) error {
18-
metrics.AddOne("device_doctor_total")
1918
results := examination().Run()
2019
for key, value := range results {
2120
fmt.Printf("%s ", key)

cmd/devicecmd/jitacmd.go

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ func jitaCommand() *cli.Command {
1818
Usage: "Connects to a JITA gateway",
1919
ArgsUsage: "gateway",
2020
Before: func(context *cli.Context) error {
21-
metrics.AddOne("jita_connect_total")
2221
if context.Args().Len() < 1 {
2322
metrics.AddOne("jita_arguments_error_total")
2423
return fmt.Errorf("missing required arguments: gateway")

cmd/devicecmd/statuscmd.go

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ func statusCommand() *cli.Command {
3636
},
3737
},
3838
Action: func(context *cli.Context) error {
39-
metrics.AddOne("device_status_total")
4039
outputFormat := context.String("output")
4140
quiet := context.Bool("quiet")
4241
verbose := context.Bool("verbose")

cmd/kubeconfigcmd/kubeconfig.go

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ gcloud auth login --update-adc`,
4242
},
4343
},
4444
Before: func(context *cli.Context) error {
45-
metrics.AddOne("kube_kubeconfig_total")
4645

4746
err := gcp.ValidateUserLogin(context.Context, false)
4847
if err != nil {

cmd/postgrescmd/grantcmd.go

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ func grantCommand() *cli.Command {
2525
},
2626
},
2727
Before: func(context *cli.Context) error {
28-
metrics.AddOne("postgres_grant_total")
2928
if context.Args().Len() < 1 {
3029
metrics.AddOne("postgres_missing_app_name_error_total")
3130
return fmt.Errorf("missing name of app")

cmd/postgrescmd/passwordrotatecmd.go

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ func passwordRotateCommand() *cli.Command {
2525
},
2626
},
2727
Before: func(context *cli.Context) error {
28-
metrics.AddOne("postgres_rotate_password_total")
2928
if context.Args().Len() < 1 {
3029
metrics.AddOne("postgres_missing_app_name_error_total")
3130
return fmt.Errorf("missing name of app")

cmd/postgrescmd/postgres.go

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ func Command() *cli.Command {
2323
Name: "postgres",
2424
Usage: "Command used for connecting to Postgres",
2525
Before: func(context *cli.Context) error {
26-
metrics.AddOne("postgres_connect_total")
2726
return gcp.ValidateUserLogin(context.Context, false)
2827
},
2928
Subcommands: commands,

cmd/postgrescmd/preparecmd.go

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ This operation is only required to run once for each postgresql instance.`,
3838
},
3939
},
4040
Before: func(context *cli.Context) error {
41-
metrics.AddOne("postgres_prepare_total")
4241
if context.Args().Len() < 1 {
4342
metrics.AddOne("postgres_prepare_missing_app_name_error_total")
4443
return fmt.Errorf("missing name of app")

cmd/postgrescmd/proxycmd.go

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ func proxyCommand() *cli.Command {
3939
},
4040
},
4141
Before: func(context *cli.Context) error {
42-
metrics.AddOne("postgres_proxy_total")
4342
if context.Args().Len() < 1 {
4443
metrics.AddOne("postgres_missing_app_name_error_total")
4544
return fmt.Errorf("missing name of app")

cmd/postgrescmd/psqlcmd.go

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ func psqlCommand() *cli.Command {
2929
},
3030
},
3131
Before: func(context *cli.Context) error {
32-
metrics.AddOne("postgres_psql_total")
3332
if context.Args().Len() < 1 {
3433
metrics.AddOne("postgres_missing_app_name_error_total")
3534
return fmt.Errorf("missing name of app")

cmd/postgrescmd/revokecmd.go

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ This operation is only required to run once for each postgresql instance.`,
3434
},
3535
},
3636
Before: func(context *cli.Context) error {
37-
metrics.AddOne("postgres_revoke_total")
3837
if context.Args().Len() < 1 {
3938
metrics.AddOne("postgres_missing_app_name_error_total")
4039
return fmt.Errorf("missing name of app")

cmd/postgrescmd/usersaddcmd.go

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ func usersAddCommand() *cli.Command {
3030
},
3131
},
3232
Before: func(context *cli.Context) error {
33-
metrics.AddOne("postgres_users_add_total")
3433
if context.Args().Len() < 3 {
3534
metrics.AddOne("postgres_missing_args_error_total")
3635
return fmt.Errorf("missing required arguments: appname, username, password")

cmd/postgrescmd/userslistcmd.go

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ func usersListCommand() *cli.Command {
2424
},
2525
},
2626
Before: func(context *cli.Context) error {
27-
metrics.AddOne("postgres_users_list_total")
2827
if context.Args().Len() < 1 {
2928
metrics.AddOne("postgres_missing_app_name_error_total")
3029
return fmt.Errorf("missing name of app")

cmd/rootcmd/login.go

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ func loginCommand() *cli.Command {
1212
Usage: "Login using Google Auth.",
1313
Description: "This is a wrapper around gcloud auth login --update-adc.",
1414
Action: func(context *cli.Context) error {
15-
metrics.AddOne("login_total")
1615
return gcp.Login(context.Context)
1716
},
1817
}

cmd/validatecmd/validate.go

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ func Command() *cli.Command {
3131
},
3232
},
3333
Before: func(context *cli.Context) error {
34-
metrics.AddOne("validate_nais_yaml_total")
3534
if context.Args().Len() == 0 {
3635
metrics.AddOne("validate_enonent_error_total")
3736
return fmt.Errorf("no config files provided")

0 commit comments

Comments
 (0)