-
Notifications
You must be signed in to change notification settings - Fork 962
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gRPC reference documentation (#4575)
- Loading branch information
1 parent
1efbccc
commit 42dd0fd
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[[overview]] | ||
= gRPC Instrumentation | ||
|
||
https://grpc.io/[gRPC] is a modern open source high performance Remote Procedure Call (RPC) framework that can run in any environment. | ||
|
||
Below you can find an example of how to instrument gRPC with Micrometer. | ||
|
||
First, client and server side interceptors need to be setup. | ||
|
||
[source,java,subs=+attributes] | ||
----- | ||
// Setting up interceptors | ||
include::{include-core-test-java}/io/micrometer/core/instrument/binder/grpc/GrpcObservationTest.java[tags=setup, indent=0] | ||
include::{include-core-test-java}/io/micrometer/core/instrument/binder/grpc/GrpcObservationTest.java[tags=setup_2, indent=0] | ||
----- | ||
|
||
Next, server and channels need to have the interceptors added. | ||
|
||
[source,java,subs=+attributes] | ||
----- | ||
// Adding them to the server and client side | ||
include::{include-core-test-java}/io/micrometer/core/instrument/binder/grpc/GrpcObservationTest.java[tags=example, indent=0] | ||
----- | ||
|
||
Below you have an example of usage with the result assertions. | ||
|
||
[source,java,subs=+attributes] | ||
----- | ||
// Usage example | ||
include::{include-core-test-java}/io/micrometer/core/instrument/binder/grpc/GrpcObservationTest.java[tags=result, indent=0] | ||
// Observation outcome | ||
include::{include-core-test-java}/io/micrometer/core/instrument/binder/grpc/GrpcObservationTest.java[tags=assertion, indent=0] | ||
----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters