You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -327,7 +327,7 @@ you should see the `timer` named `grpc.server.calls`.
327
327
==== Custom tags support
328
328
329
329
By defining `GRpcMetricsTagsContributor` bean in your application context, you can add custom tags to the `grpc.server.calls` timer. +
330
-
You can also use `RequestAwareGRpcMetricsTagsContributor` bean to tag *unary* calls. +
330
+
You can also use `RequestAwareGRpcMetricsTagsContributor` bean to tag *unary* and *streaming* calls. +
331
331
Demo is https://github.com/LogNet/grpc-spring-boot-starter/blob/master/grpc-spring-boot-starter-demo/src/test/java/org/lognet/springboot/grpc/GrpcMeterTest.java[here]
332
332
333
333
[TIP]
@@ -762,7 +762,6 @@ class MyClient{
762
762
<3> Turn the binary format on/off: +
763
763
* When `true`, the authentication header is sent with `Authentication-bin` key using https://grpc.github.io/grpc-java/javadoc/io/grpc/Metadata.BinaryMarshaller.html[binary marshaller].
764
764
* When `false`, the authentication header is sent with `Authentication` key using https://grpc.github.io/grpc-java/javadoc/io/grpc/Metadata.AsciiMarshaller.html[ASCII marshaller].
765
-
766
765
<4> Provide token generator function (Please refer to link:grpc-spring-boot-starter-demo/src/test/java/org/lognet/springboot/grpc/auth/JwtAuthBaseTest.java[for example].)
767
766
768
767
Per-call::
@@ -798,6 +797,11 @@ class MyClient{
798
797
.tokenSupplier(()->generateMyCustomToken())
799
798
----
800
799
800
+
== Health check
801
+
802
+
The starter registers the default implementation of https://github.com/grpc/grpc-java/blob/bab1fe38dc/services/src/main/java/io/grpc/protobuf/services/HealthServiceImpl.java[HealthServiceImpl]. +
803
+
You can provide you own by registering link:./grpc-spring-boot-starter/src/main/java/org/lognet/springboot/grpc/health/ManagedHealthStatusService.java[ManagedHealthStatusService] bean in your application context.
804
+
801
805
== Consul Integration
802
806
803
807
Starting from version `3.3.0`, the starter will auto-register the running grpc server in Consul registry if `org.springframework.cloud:spring-cloud-starter-consul-discovery` is in classpath and
@@ -809,7 +813,26 @@ Setting `spring.cloud.consul.discovery.register-health-check` to true will regis
809
813
810
814
Tags could be set by defining `spring.cloud.consul.discovery.tags` property.
811
815
812
-
You can find the test that demonstrates the feature link:grpc-spring-boot-starter-demo/src/test/java/org/lognet/springboot/grpc/ConsulRegistrationTest.java[here].
816
+
There are 3 supported registration modes :
817
+
818
+
. `SINGLE_SERVER_WITH_GLOBAL_CHECK` (default) +
819
+
In this mode the running grpc server is registered as single service with single `grpc` check with empty `serviceId`. +
820
+
Please note that default implementation https://github.com/grpc/grpc-java/blob/bab1fe38dc50d4178955b79cfb1636afd2aa64df/services/src/main/java/io/grpc/protobuf/services/HealthServiceImpl.java#L64[does nothing] and simply returns `SERVING` status. You might want to provide your custom <<Health check>> implementation for this mode.
821
+
. `SINGLE_SERVER_WITH_CHECK_PER_SERVICE` +
822
+
In this mode the running grpc server is registered as single service with check per each discovered `grpc` service.
823
+
. `STANDALONE_SERVICES` +
824
+
In this mode each discovered grpc service is registered as single service with single check. Each registered service is tagged by its own service name.
825
+
826
+
[source,yml]
827
+
.You can control the desired mode from application.properties
0 commit comments