uptime-kuma
uptime-kuma copied to clipboard
Feat/add gRPC protocol
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)
Hi @louislam, could you please take a look this PR
Been waiting for this. Our services mostly use GRPC.
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 yeap, I think it was the same purpose 😀
Our team has the same problem @@ Been waiting for this :D
Will it be merged, @louislam :sob: ?
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/).
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.
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. 👀
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:
- 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
- Input the keyword for uptime validates the gRPC service is still alive
- For the gRPC options you input as the picture below
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
The proto service name is located in the helloworld.proto (examples/protos/helloworld.proto), and you input the same to proto service name
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)
Copy the content of helloworld.proto to the proto content. We will store the proto file as the string content in our persistent data
Input the request body following the proto content
The testing will have the result below:
Note: you can download bloomRPC and import the helloworld.proto for interacting with the example gRPC server without Uptime
Hi @louislam, will this feature be shipped in the v1.19.0?
Thanks for your pr and the testing guide!