For a metrics collection library for Go, the first results are go-kit/kit (This is a comprehensive microservices framework that includes a robust, Prometheus-compatible instrumentation toolkit for collecting and exporting metrics, though it is a broader architectural suite rather than a standalone metrics library), prometheus/client_golang (This is the official Go client library for Prometheus, providing the standard way to instrument applications with custom metrics, high-performance registries, and native support for Prometheus-style scraping) and rcrowley/go-metrics (This library provides a comprehensive suite of Go-native metric types for instrumentation, though you will need to use additional adapters or exporters to achieve full Prometheus compatibility and push/pull functionality). hashicorp/go-metrics and census-instrumentation/opencensus-go round out the shortlist. Compare the match explanations and check the project documentation against your requirements.
We curate open-source GitHub repositories matching “best go metrics libraries”. Results are ranked by relevance to your query — pick filters below to narrow, or refine with AI.
Kit is a microservices architectural framework and toolkit for Go. It provides a set of standardized primitives and abstractions for implementing service, endpoint, and transport layers in a decoupled manner. The framework focuses on system instrumentation through integrated distributed request tracing and a service instrumentation toolkit that utilizes counters and gauges to export performance data to external monitoring backends. It includes a structured logging library that records system events as key-value pairs to ensure compatibility with log aggregation tools. The project covers a br
This is a comprehensive microservices framework that includes a robust, Prometheus-compatible instrumentation toolkit for collecting and exporting metrics, though it is a broader architectural suite rather than a standalone metrics library.
Prometheus client_golang is the official Go client library for instrumenting applications with Prometheus metrics. It provides a metric registry that manages and exposes custom application metrics like counters, gauges, histograms, and summaries in Prometheus format for HTTP scraping by a Prometheus server. The library also includes a remote read client that sends PromQL queries to a Prometheus server over HTTP and retrieves time series data programmatically. The library supports creating separate registries to isolate metric namespaces and control which metrics are exposed per scrape endpoin
This is the official Go client library for Prometheus, providing the standard way to instrument applications with custom metrics, high-performance registries, and native support for Prometheus-style scraping.
This library provides a toolkit for instrumenting Go applications with performance metrics, enabling the tracking of counters, gauges, and timers. It serves as a foundational framework for recording application behavior and resource usage, offering thread-safe primitives to manage the lifecycle of these instruments within a central registry. The system distinguishes itself through a high-performance design that utilizes atomic operations to track event frequencies, avoiding the overhead of mutex locks during execution. It employs snapshot-based sampling to capture point-in-time data, ensuring
This library provides a comprehensive suite of Go-native metric types for instrumentation, though you will need to use additional adapters or exporters to achieve full Prometheus compatibility and push/pull functionality.
This library provides a toolkit for instrumenting Go applications to track performance data, including counters, gauges, and timers. It serves as a centralized facility for collecting, storing, and exporting runtime metrics to external monitoring and telemetry platforms. The project distinguishes itself through a pluggable architecture that decouples application instrumentation from specific output formats. It manages metric data through a registry that supports concurrent updates and provides granular control over data volume by filtering metric labels before transmission. To support operati
This library provides a Go-native way to instrument and export application metrics to various backends, though it focuses more on push-based systems like StatsD than the pull-based Prometheus model.
OpenCensus-go is an observability instrumentation library designed to capture and export telemetry data from distributed systems. It functions as a framework for application performance monitoring and distributed request tracing, allowing developers to track system health, latency, and the progression of requests across service boundaries. The project distinguishes itself through a modular architecture that decouples data collection from storage. By utilizing a pluggable exporter interface, it enables the transmission of metrics and trace data to a variety of external monitoring and analysis
This library provides a comprehensive framework for instrumenting Go applications with metrics and distributed tracing, offering Prometheus compatibility and a pluggable exporter system that supports both push and pull models.
mtail is a log-based metrics extractor and time-series monitoring agent. It functions as a log pattern parser that transforms unstructured log text into structured numerical monitoring data without requiring modifications to the original source code. The tool operates as a push-based telemetry pipeline, aggregating extracted metrics in memory before transmitting them to remote monitoring endpoints and time-series databases. Its capabilities cover log data telemetry, application performance monitoring, and custom log monitoring through a pipeline that moves parsed data from text logs to exter
This tool is a log-based monitoring agent that extracts metrics from existing log files rather than a library for instrumenting application code directly.
Giropops-monitoring is an integrated observability platform designed to monitor the health and performance of containerized infrastructure. It provides a containerized suite that orchestrates the deployment of monitoring services, enabling the collection, storage, and visualization of system metrics across distributed environments. The platform utilizes a pull-based approach to scrape performance data from target nodes, storing these metrics in a specialized time-series database for long-term analysis. Users can inspect this data through interactive, web-based dashboards that render real-time
This repository is a containerized observability platform and deployment suite rather than a Go-native library for instrumenting application code.
This is a structured logging library designed to produce logs using key-value pairs, severity levels, and machine-readable formats. It provides a toolkit for creating logs that are consistent for both human review and machine parsing. The project is distinguished by its focus on terminal visualization, using a styling system to apply colors and prefixes to log entries for improved readability in consoles. It also includes a specialized adapter to convert standard library log calls into structured events by inferring severity levels from message prefixes. The library manages metadata through
This is a structured logging library for terminal output and machine-readable logs, which is a different category than a metrics instrumentation library for monitoring systems.
dockprom is a monitoring stack based on Prometheus and Grafana designed to track the performance of Docker containers and their underlying hosts. It functions as a complete solution for gathering real-time metrics and displaying them through a self-hosted dashboard. The project includes a suite of tools for collecting container and host metrics, as well as a discovery tool specifically for automatically identifying and adding tagged EC2 instances to the monitoring configuration. The system covers several observability areas, including time-series data storage and the creation of performance
This repository is a pre-configured monitoring stack for Docker environments rather than a Go library for instrumenting application code, making it a tool you would use to monitor your services rather than a library to integrate into them.
Nezha is a multi-server infrastructure monitor and website uptime monitor that provides a centralized dashboard for tracking real-time resource utilization and system health. It functions as a protocol server and alerting engine, utilizing remote agents to collect telemetry data across multiple operating systems. The system distinguishes itself with a web-based remote administration interface, allowing users to execute maintenance commands and manage scheduled tasks on remote hosts via a browser-based terminal. It also integrates a Model Context Protocol server to provide a secure HTTP entry
Nezha is a complete infrastructure monitoring and server management application rather than a library for instrumenting and exporting metrics from your own Go applications.
Logrus is a structured logging library for Go that produces machine-readable output using key-value pairs and JSON formatting. It serves as a pluggable logging framework providing a thread-safe event logger with configurable mutex locking to manage concurrent writes across multiple goroutines. The project distinguishes itself through a pluggable hook system that routes log entries to external services or custom destinations. It also features a contextual logger capable of attaching persistent metadata and request-scoped fields to entries to improve traceability. The framework covers broad ob
Logrus is a structured logging library rather than a metrics instrumentation tool, and while it can export logs to monitoring services, it lacks the core capability to define, collect, and aggregate custom application metrics.
The Prometheus Operator is a Kubernetes monitoring orchestrator and controller that manages Prometheus clusters and observability components through declarative custom resources. It functions as a custom resource controller that translates high-level Kubernetes resource definitions into the configuration files required by the underlying monitoring software. The project automates the deployment, scaling, and lifecycle of an observability stack, including the integration of components like Thanos and Alertmanager. It distinguishes itself by syncing monitoring targets, alerting rules, and scrape
This is a Kubernetes operator for managing and orchestrating Prometheus clusters rather than a library for instrumenting application code with custom metrics.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| go-kit/kit | 27.4K | Go | MIT | |
| prometheus/client_golang | 6K | Go | Apache-2.0 | |
| rcrowley/go-metrics |
| 3.5K |
| Go |
| NOASSERTION |
| hashicorp/go-metrics | 1.6K | Go | MIT |
| census-instrumentation/opencensus-go | 2K | Go | Apache-2.0 |
| google/mtail | 4K | Go | Apache-2.0 |
| badtuxx/giropops-monitoring | 1.3K | Dockerfile | Apache-2.0 |
| charmbracelet/log | 3.1K | Go | mit |
| stefanprodan/dockprom | 6.6K | — | MIT |
| nezhahq/nezha | 10.2K | Go | Apache-2.0 |