You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/07/20 07:36:11 UTC

[GitHub] [skywalking-cli] hanahmily opened a new pull request #44: Add gRPC health check

hanahmily opened a new pull request #44:
URL: https://github.com/apache/skywalking-cli/pull/44


   Add the feature of gRPC health check and set exit code.
   
   Signed-off-by: Gao Hongtao <ha...@gmail.com>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-cli] kezhenxu94 commented on pull request #44: Add gRPC health check

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on pull request #44:
URL: https://github.com/apache/skywalking-cli/pull/44#issuecomment-660999077


   There're some problems with the clone step, it is still cloning the old codes, checking why


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-cli] hanahmily commented on a change in pull request #44: Add gRPC health check

Posted by GitBox <gi...@apache.org>.
hanahmily commented on a change in pull request #44:
URL: https://github.com/apache/skywalking-cli/pull/44#discussion_r457323442



##########
File path: commands/common/common.go
##########
@@ -18,19 +18,50 @@
 package common
 
 import (
+	"fmt"
+
 	"github.com/urfave/cli"
 
-	"github.com/apache/skywalking-cli/display"
-	"github.com/apache/skywalking-cli/display/displayable"
 	"github.com/apache/skywalking-cli/graphql/common"
+	"github.com/apache/skywalking-cli/grpc"
 )
 
 var Command = cli.Command{
 	Name:    "checkHealth",
 	Aliases: []string{"ch"},
 	Usage:   "Check the health status of OAP server",
+	Flags: []cli.Flag{
+		cli.BoolTFlag{
+			Name:     "grpc",
+			Usage:    "Check gRPC by HealthCheck service",
+			Required: false,
+		},
+		cli.StringFlag{
+			Name:     "grpcAddr",
+			Usage:    "`host:port` to connect",
+			Value:    "127.0.0.1:11800",
+			Required: false,
+		},
+		cli.BoolFlag{
+			Name:     "grpcTLS",
+			Usage:    "use TLS for gRPC",
+			Required: false,
+		},
+	},
 	Action: func(ctx *cli.Context) error {
 		healthStatus := common.CheckHealth(ctx)
-		return display.Display(ctx, &displayable.Displayable{Data: healthStatus})
+		if healthStatus.Score != 0 {
+			return cli.NewExitError(healthStatus.Details, healthStatus.Score)
+		}
+		fmt.Println("OAP modules are healthy")

Review comment:
       done




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-cli] kezhenxu94 merged pull request #44: Add gRPC health check

Posted by GitBox <gi...@apache.org>.
kezhenxu94 merged pull request #44:
URL: https://github.com/apache/skywalking-cli/pull/44


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-cli] kezhenxu94 closed pull request #44: Add gRPC health check

Posted by GitBox <gi...@apache.org>.
kezhenxu94 closed pull request #44:
URL: https://github.com/apache/skywalking-cli/pull/44


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-cli] wu-sheng commented on pull request #44: Add gRPC health check

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #44:
URL: https://github.com/apache/skywalking-cli/pull/44#issuecomment-661512955


   NOTICE, this PR doesn't include the LICENSE update. We need to fix this before release.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-cli] kezhenxu94 commented on a change in pull request #44: Add gRPC health check

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #44:
URL: https://github.com/apache/skywalking-cli/pull/44#discussion_r457149409



##########
File path: commands/common/common.go
##########
@@ -18,19 +18,50 @@
 package common
 
 import (
+	"fmt"
+
 	"github.com/urfave/cli"
 
-	"github.com/apache/skywalking-cli/display"
-	"github.com/apache/skywalking-cli/display/displayable"
 	"github.com/apache/skywalking-cli/graphql/common"
+	"github.com/apache/skywalking-cli/grpc"
 )
 
 var Command = cli.Command{
 	Name:    "checkHealth",
 	Aliases: []string{"ch"},
 	Usage:   "Check the health status of OAP server",
+	Flags: []cli.Flag{
+		cli.BoolTFlag{
+			Name:     "grpc",
+			Usage:    "Check gRPC by HealthCheck service",
+			Required: false,
+		},
+		cli.StringFlag{
+			Name:     "grpcAddr",
+			Usage:    "`host:port` to connect",
+			Value:    "127.0.0.1:11800",
+			Required: false,
+		},
+		cli.BoolFlag{
+			Name:     "grpcTLS",
+			Usage:    "use TLS for gRPC",
+			Required: false,
+		},
+	},
 	Action: func(ctx *cli.Context) error {
 		healthStatus := common.CheckHealth(ctx)
-		return display.Display(ctx, &displayable.Displayable{Data: healthStatus})
+		if healthStatus.Score != 0 {
+			return cli.NewExitError(healthStatus.Details, healthStatus.Score)
+		}
+		fmt.Println("OAP modules are healthy")

Review comment:
       Can we use the same logger as other commands so that the users can control what kind of logs to be displayed and the log format is consistent
   
   > and other `fmt.Println`, `fmt.Printf` in this PR




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org