diff --git a/internal/cmd/egctl/envoy_stats.go b/internal/cmd/egctl/envoy_stats.go index 2d127fcf12ca..cf943d04332a 100644 --- a/internal/cmd/egctl/envoy_stats.go +++ b/internal/cmd/egctl/envoy_stats.go @@ -29,26 +29,26 @@ var ( statsType, outputFormat string ) -func newEnvoyStatsConfigCmd() *cobra.Command { +func newEnvoyStatsCmd() *cobra.Command { var podName, podNamespace string statsConfigCmd := &cobra.Command{ - Use: "stats [/][.]", + Use: "envoy-proxy [/][.]", Short: "Retrieves Envoy metrics in the specified pod", Long: `Retrieve Envoy emitted metrics for the specified pod.`, Example: ` # Retrieve Envoy emitted metrics for the specified pod. egctl experimental stats # Retrieve Envoy server metrics in prometheus format - egctl experimental stats --output prom + egctl experimental stats envoy-proxy --output prom # Retrieve Envoy server metrics in prometheus format with merged application metrics - egctl experimental stats --output prom-merged + egctl experimental stats envoy-proxy --output prom-merged # Retrieve Envoy cluster metrics - egctl experimental stats --type clusters + egctl experimental stats envoy-proxy --type clusters `, - Aliases: []string{"es"}, + Aliases: []string{"ep"}, Args: func(cmd *cobra.Command, args []string) error { if len(args) != 1 && len(labelSelectors) == 0 { cmd.Println(cmd.UsageString()) diff --git a/internal/cmd/egctl/experimental.go b/internal/cmd/egctl/experimental.go index 03218bf435f7..7fb744fb8de4 100644 --- a/internal/cmd/egctl/experimental.go +++ b/internal/cmd/egctl/experimental.go @@ -23,7 +23,7 @@ func newExperimentalCommand() *cobra.Command { } experimentalCommand.AddCommand(NewTranslateCommand()) - experimentalCommand.AddCommand(newEnvoyStatsConfigCmd()) + experimentalCommand.AddCommand(statsCommand()) return experimentalCommand } diff --git a/internal/cmd/egctl/stats.go b/internal/cmd/egctl/stats.go new file mode 100644 index 000000000000..2e8ccca90bf4 --- /dev/null +++ b/internal/cmd/egctl/stats.go @@ -0,0 +1,21 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +package egctl + +import ( + "github.com/spf13/cobra" +) + +func statsCommand() *cobra.Command { + c := &cobra.Command{ + Use: "stats", + Long: "Retrieve stats from envoy proxy.", + } + + c.AddCommand(newEnvoyStatsCmd()) + + return c +} \ No newline at end of file