A Go package for monitoring application and system statistics (memory, CPU, goroutines) and sending them via UDP for logging.
go-playground/stats is a Go library that collects detailed statistics from a Go application and its underlying operating system. It monitors garbage collection, memory usage, CPU performance, and HTTP requests, then sends this data via UDP to a configurable server for processing, storage, or analysis. The package is designed to provide essential observability without imposing specific storage or visualization solutions.
Go developers and system administrators who need lightweight, customizable monitoring for Go applications in production or development environments. It is particularly useful for teams building distributed systems or services that require granular performance insights without heavy dependencies.
Developers choose this library for its non-intrusive, UDP-based approach that decouples data collection from processing, allowing flexibility in how statistics are handled. Unlike integrated monitoring solutions, it focuses solely on gathering and transmitting metrics, letting users pipe data to their preferred databases, logging services, or dashboards.
:chart_with_upwards_trend: Monitors Go MemStats + System stats such as Memory, Swap and CPU and sends via UDP anywhere you want for logging etc...
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Tracks garbage collection cycles, memory allocation, goroutine count, and Go version, providing deep insights into application performance as listed in the README's Go-related information section.
Captures host info, CPU timings (total and per-core), and memory/swap usage, enabling full system observability without external tools, based on the README's system information features.
Sends stats over UDP to any configurable server, allowing decoupled data processing and integration with custom backends, as emphasized in the library's philosophy of non-intrusive observability.
Includes middleware for logging HTTP request details and tracking completion or failures, useful for web applications, with example code provided in the README for standard Go middleware.
Allows adjustable polling intervals and selective logging of metrics via ClientConfig, giving control over data collection frequency and scope to minimize overhead.
Uses UDP, which is connectionless and prone to packet loss, making it unsuitable for applications where data integrity is critical, as the library doesn't handle retries or guarantees delivery.
Lacks out-of-the-box dashboards, storage, or alerting features, forcing users to implement their own data processing pipelines, which adds complexity compared to all-in-one monitoring solutions.
Relies on the gopsutil library for system metrics, as noted in the licenses, which may introduce compatibility issues, bugs, or platform limitations beyond the core library's control.