Class PoolingHttpClientConnectionManagerMetricsBinder
java.lang.Object
io.micrometer.core.instrument.binder.httpcomponents.hc5.PoolingHttpClientConnectionManagerMetricsBinder
- All Implemented Interfaces:
MeterBinder
Collects metrics from a
ConnPoolControl
, for example
PoolingHttpClientConnectionManager
for synchronous HTTP clients or
PoolingAsyncClientConnectionManager
for asynchronous HTTP clients.
It monitors the overall connection pool state. Usage example:
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager();
HttpClient httpClient = HttpClientBuilder.create().setConnectionManager(connectionManager).build();
new PoolingHttpClientConnectionManagerMetricsBinder(connectionManager, "my-pool").bindTo(registry);
- Since:
- 1.11.0
-
Constructor Summary
ConstructorDescriptionPoolingHttpClientConnectionManagerMetricsBinder
(org.apache.hc.core5.pool.ConnPoolControl<org.apache.hc.client5.http.HttpRoute> connPoolControl, String name, Iterable<Tag> tags) Creates a metrics binder for the given connection pool control.PoolingHttpClientConnectionManagerMetricsBinder
(org.apache.hc.core5.pool.ConnPoolControl<org.apache.hc.client5.http.HttpRoute> connPoolControl, String name, String... tags) Creates a metrics binder for the given pooling connection pool control. -
Method Summary
-
Constructor Details
-
PoolingHttpClientConnectionManagerMetricsBinder
public PoolingHttpClientConnectionManagerMetricsBinder(org.apache.hc.core5.pool.ConnPoolControl<org.apache.hc.client5.http.HttpRoute> connPoolControl, String name, String... tags) Creates a metrics binder for the given pooling connection pool control.- Parameters:
connPoolControl
- The connection pool control to monitor.name
- Name of the connection pool control. Will be added as tag with the key "httpclient".tags
- Tags to apply to all recorded metrics. Must be an even number of arguments representing key/value pairs of tags.
-
PoolingHttpClientConnectionManagerMetricsBinder
public PoolingHttpClientConnectionManagerMetricsBinder(org.apache.hc.core5.pool.ConnPoolControl<org.apache.hc.client5.http.HttpRoute> connPoolControl, String name, Iterable<Tag> tags) Creates a metrics binder for the given connection pool control.- Parameters:
connPoolControl
- The connection pool control to monitor.name
- Name of the connection pool control. Will be added as tag with the key "httpclient".tags
- Tags to apply to all recorded metrics.
-
-
Method Details
-
bindTo
- Specified by:
bindTo
in interfaceMeterBinder
-