Description
Package provides simple uniform interface for metrics such as counters,
gauges and histograms. It keeps track of metrics in runtime and can be used for
some basic web service instrumentation in Go, where complex tools such as
Prometheus or InfluxDB are not required.
It is compatible with expvar package, that is also commonly used for monitoring.
metric alternatives and similar packages
Based on the "DevOps Tools" category.
Alternatively, view metric alternatives based on common mentions on social networks and blogs.
-
Gitea
Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD -
Moby
The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems -
Packer
Packer is a tool for creating identical machine images for multiple platforms from a single source configuration. -
kubeshark
The API traffic analyzer for Kubernetes providing real-time K8s protocol-level visibility, capturing and monitoring all traffic and payloads going in, out and across containers, pods, nodes and clusters. Inspired by Wireshark, purposely built for Kubernetes -
Ddosify
Anteon (formerly Ddosify) - Effortless Kubernetes Monitoring and Performance Testing. Available on CLI, Self-Hosted, and Cloud -
dasel
Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool. Supports conversion between formats and can be used as a Go package. -
Mizu
DISCONTINUED. The API traffic viewer for Kubernetes providing deep visibility into all API traffic and payloads going in, out and across containers and pods inside a Kubernetes cluster. Think TCPDump and Wireshark re-invented for Kubernetes [Moved to: https://github.com/kubeshark/kubeshark] -
Pomerium
Pomerium is an identity and context-aware reverse proxy for zero-trust access to web applications and services. -
Fleet device management
Open-source platform for IT, security, and infrastructure teams. (Linux, macOS, Chrome, Windows, cloud, data center) -
StatusOK
Monitor your Website and APIs from your Computer. Get Notified through Slack, E-mail when your server is down or response time is more than expected. -
uTask
µTask is an automation engine that models and executes business processes declared in yaml. ✏️📋 -
s3gof3r
Fast, concurrent, streaming access to Amazon S3, including gof3r, a CLI. http://godoc.org/github.com/rlmcpherson/s3gof3r
CodeRabbit: AI Code Reviews for Developers
Do you think we are missing an alternative of metric or a related project?
Popular Comparisons
README
metric
Package provides simple uniform interface for metrics such as counters, gauges and histograms. It keeps track of metrics in runtime and can be used for some basic web service instrumentation in Go, where complex tools such as Prometheus or InfluxDB are not required.
It is compatible with expvar package, that is also commonly used for monitoring.
Usage
// Create new metric. All metrics may take time frames if you want them to keep
// history. If no time frames are given the metric only keeps track of a single
// current value.
c := metric.NewCounter("15m10s") // 15 minutes of history with 10 second precision
// Increment counter
c.Add(1)
// Return JSON with all recorded counter values
c.String() // Or json.Marshal(c)
// With expvar
// Register a metric
expvar.Publish("latency", metric.NewHistogram("5m1s", "15m30s", "1h1m"))
// Register HTTP handler to visualize metrics
http.Handle("/debug/metrics", metric.Handler(metric.Exposed))
// Measure time and update the metric
start := time.Now()
...
expvar.Get("latency").(metric.Metric).Add(time.Since(start).Seconds())
Metrics are thread-safe and can be updated from background goroutines.
Web UI
Nothing fancy, really, but still better than reading plain JSON. No javascript, only good old HTML, CSS and SVG.
[web ui](example/screenshot.png)
Of course you may customize a list of metrics to show in the web UI.
If you need precise values - you may use /debug/vars
HTTP endpoint provided
by expvar
.
License
Code is distributed under MIT license, feel free to use it in your proprietary projects as well.
*Note that all licence references and agreements mentioned in the metric README section above
are relevant to that project's source code only.