uptime-kuma icon indicating copy to clipboard operation
uptime-kuma copied to clipboard

Feat/add gRPC protocol

Open minhhoangvn opened this issue 2 years ago • 8 comments

Description

Added gRPC protocol for health check service #1963

Type of change

Please delete any options that are not relevant.

  • User interface (UI)
  • New feature (non-breaking change which adds functionality)

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I ran ESLint and other linters for modified files
  • [x] I have performed a self-review of my own code and tested it
  • [x] I have commented my code, particularly in hard-to-understand areas (including JSDoc for methods)
  • [ ] My changes generate no new warnings
  • [ ] My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

image

image

minhhoangvn avatar Aug 03 '22 05:08 minhhoangvn

Hi @louislam, could you please take a look this PR

minhhoangvn avatar Aug 03 '22 06:08 minhhoangvn

Been waiting for this. Our services mostly use GRPC.

khoant94 avatar Aug 03 '22 07:08 khoant94

Is it the same purpose with #1833?

If yes, I may choose your implementation, since yours implementation is using nodejs library, while #1833 is using external command.

louislam avatar Aug 03 '22 13:08 louislam

@louislam yeap, I think it was the same purpose 😀

minhhoangvn avatar Aug 03 '22 13:08 minhhoangvn

Our team has the same problem @@ Been waiting for this :D

TrongHan avatar Aug 08 '22 02:08 TrongHan

Will it be merged, @louislam :sob: ?

minhhoangvn avatar Aug 13 '22 06:08 minhhoangvn

GRPC is pretty new to me, could you provide a simple testing guide for me to test it, thanks.

I am using the grpc example server greeter_server.js from the official tutorial (https://grpc.io/docs/languages/node/quickstart/).

louislam avatar Sep 13 '22 14:09 louislam

If anyone want to test this pull request, you can use this command:

docker run --rm -it -p 3000:3000 -p 3001:3001 --pull always -e 'UPTIME_KUMA_GH_REPO=minhhoangvn:feat/add-gRPC-protocol' louislam/uptime-kuma:pr-test

Go to http://localhost:3000/ after started.

louislam avatar Sep 13 '22 14:09 louislam

GRPC is pretty new to me, could you provide a simple testing guide for me to test it, thanks.

I am using the grpc example server greeter_server.js from the official tutorial (https://grpc.io/docs/languages/node/quickstart/).

Ping @minhhoangvn, need your assistance. 👀

louislam avatar Oct 08 '22 19:10 louislam

Hi @louislam, sorry for my late response. I did not see your comment about the concern with testing the gRPC in Uptime, just only see the comment about the docker image for testing 🥲

You can use the gRPC example server in the official tutorial and follow the guideline below for testing:

  1. Input the URL as the picture below if you start the example without changing its port. The URL must use the domain name with the gRPC server port, and without the protocol; in this case, it will be localhost:50051 image
  2. Input the keyword for uptime validates the gRPC service is still alive image
  3. For the gRPC options you input as the picture below image

The explanation for the configuration options:

The example service is running on our local machine and without the TLS; thus, we will not enable the TLS option image

The proto service name is located in the helloworld.proto (examples/protos/helloworld.proto), and you input the same to proto service name image

The proto method name is the method that will be used by Uptime to verify the gRPC service is still alive. In the example, it will be a SayHello method, and we need to rename it to camelCase when input to the method name in Uptime (the library in NodeJS requires this format) image

Copy the content of helloworld.proto to the proto content. We will store the proto file as the string content in our persistent data image

Input the request body following the proto content image

The testing will have the result below: image

Note: you can download bloomRPC and import the helloworld.proto for interacting with the example gRPC server without Uptime image

minhhoangvn avatar Oct 09 '22 02:10 minhhoangvn

Hi @louislam, will this feature be shipped in the v1.19.0?

minhhoangvn avatar Oct 26 '22 13:10 minhhoangvn

Thanks for your pr and the testing guide!

louislam avatar Nov 11 '22 04:11 louislam