-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
123 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[[overview]] | ||
= Apache HttpComponents Client Instrumentation | ||
|
||
IMPORTANT: This section requires usage of Apache HttpComponents Client at least in version 5. | ||
|
||
https://hc.apache.org/index.html/[Apache HttpComponents Client] is an HTTP/1.1 compliant HTTP agent implementation. | ||
|
||
Below you can find an example of how to instrument Apache HttpComponents Client with Micrometer. | ||
|
||
Example of classic, blocking HTTP client. | ||
|
||
[source,java,subs=+attributes] | ||
----- | ||
// Setting up instrumentation (you need to create a client from the builder) | ||
include::{include-core-test-java}/io/micrometer/core/instrument/binder/httpcomponents/hc5/ObservationExecChainHandlerIntegrationTest.java[tags=setup_classic, indent=0] | ||
// Usage example | ||
include::{include-core-test-java}/io/micrometer/core/instrument/binder/httpcomponents/hc5/ObservationExecChainHandlerIntegrationTest.java[tags=example_classic, indent=0] | ||
----- | ||
|
||
Example of async HTTP client. | ||
|
||
[source,java,subs=+attributes] | ||
----- | ||
// Setting up instrumentation (you need to create a client from the builder) | ||
include::{include-core-test-java}/io/micrometer/core/instrument/binder/httpcomponents/hc5/ObservationExecChainHandlerIntegrationTest.java[tags=setup_async, indent=0] | ||
// Usage example | ||
include::{include-core-test-java}/io/micrometer/core/instrument/binder/httpcomponents/hc5/ObservationExecChainHandlerIntegrationTest.java[tags=example_async, 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
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
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