Micrometer is a Java library that provides a unified facade for application metrics, enabling instrumentation of code with counters, timers, gauges, and distribution summaries, and publishing them to various monitoring backends (Prometheus, Datadog, OTLP, Graphite, InfluxDB, etc.). It is not an application itself but a library designed to be embedded in Java applications. The architecture is modular: the core module defines the metrics API and abstractions (MeterRegistry, Meter, Counter, Timer, Gauge, DistributionSummary), while separate implementation modules provide backend-specific registries with their own naming conventions and transport protocols. Additionally, the observation module offers a higher-level API for tracing and context propagation, bridging metrics with observability. Key entry points include the MeterRegistry (for creating and managing meters) and the ObservationRegistry (for observation lifecycle). Data flows involve application code recording measurements via meters, which are aggregated in-memory and periodically pushed to configured backends via HTTP, UDP, or other protocols. The library also includes extensive instrumentation binders for popular frameworks (Jetty, OkHttp, gRPC, Kafka, JVM internals, etc.) that automatically collect metrics from those systems. External dependencies vary by implementation module but include HTTP clients (OkHttp, HttpURLConnection), monitoring system SDKs (AWS SDK for CloudWatch, Google Cloud for Stackdriver), and protocol libraries (OTel protobuf, StatsD). The core module has minimal dependencies, relying only on Java standard library and optional logging frameworks (SLF4J, Log4j, Logback).
DynamicTp is a Java library for dynamic thread pool management, primarily targeting Spring Boot applications. It allows runtime modification of thread pool parameters (core size, max size, queue capacity, etc.) via configuration centers like Nacos, Apollo, Zookeeper, Consul, Etcd, and Polaris. The library provides a rich set of executor variants (eager, ordered, priority, scheduled) and integrates with over a dozen middleware frameworks (Dubbo, gRPC, RocketMQ, RabbitMQ, Tomcat, Jetty, Undertow, Hystrix, Motan, OkHttp3, Thrift, SofaRPC, Tars, LiteFlow, brpc) by wrapping their native thread pools. It includes comprehensive monitoring and alerting: metrics collection via Micrometer, JMX, and logging; notification channels for DingTalk, WeChat, Lark, email, and custom notifiers; and alarm thresholds for capacity, liveness, rejections, and timeouts. The architecture is modular: a core module defines executors, registries, and lifecycle management; a common module provides utilities, parsers, queues, and SPI extension points; adapter modules wrap middleware executors; starter modules provide Spring Boot auto-configuration; and extension modules add optional features like Redis rate limiting and OpenTelemetry tracing. Key entry points are the @EnableDynamicTp annotation, DtpRegistry for executor registration, and ThreadPoolBuilder for programmatic pool creation. External dependencies include Spring Boot, Guava EventBus, ByteBuddy (for interception), Micrometer, and various config-center client libraries.
This is a Spring Boot starter library that deeply integrates Square's Retrofit HTTP client with Spring Boot's auto-configuration, allowing developers to declare typed HTTP APIs via Java interfaces annotated with `@RetrofitClient`. The library provides a comprehensive set of features: automatic OkHttpClient management, a pluggable interceptor chain (global, network, path-match), configurable retry with exponential backoff and jitter, circuit breaking (via Sentinel or Resilience4j), logging strategies, Micrometer metrics, custom error decoding, and connection pooling. It also supports Spring Boot Actuator for runtime introspection, GraalVM native image/AOT compilation, and reactive call adapters (RxJava 2/3, Reactor). The architecture is modular with clear SPIs for extensibility (e.g., `SourceOkHttpClientRegistrar`, `GlobalInterceptor`, `RetrofitDegrade`, `ErrorDecoder`), and the configuration is annotation-driven with global defaults overridable per-client. The codebase is well-tested with integration tests using MockWebServer, and documentation is provided in multiple languages. However, the tight coupling to specific versions of Retrofit, OkHttp, and Spring Boot introduces moderate technical drift, as some optional dependencies (e.g., Sentinel 1.8.6, Resilience4j 1.7.1) are older. The library is primarily a framework integration rather than a standalone application, but its design patterns serve as a reference for building Spring Boot auto-configuration with complex SPI chains.