Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Kurukshetran/812736354f087e386b36112fe7b517a6 to your computer and use it in GitHub Desktop.
Save Kurukshetran/812736354f087e386b36112fe7b517a6 to your computer and use it in GitHub Desktop.
Micrometer metrics exporter for apache http connection pool
1. Create a scheduler to add new routes
@Scheduled(fixedRate = 300000)
public void updateHttpRoutes() {
Set<HttpRoute> routes = poolingHttpClientConnectionManager.getRoutes();
for (HttpRoute route : routes) {
httpMetricsTracker.add(route, poolingHttpClientConnectionManager);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment