All Projects → VictoriaMetrics → Metrics

VictoriaMetrics / Metrics

Licence: mit
Lightweight alternative to github.com/prometheus/client_golang

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Metrics

sabotage
a radical and experimental distribution based on musl libc and busybox
Stars: ✭ 502 (+97.64%)
Mutual labels:  fast, lightweight
flask prometheus metrics
Prometheus Metrics for Flask Web App
Stars: ✭ 17 (-93.31%)
Mutual labels:  metrics, prometheus
aws-ec2-sg-exporter
A dockerized Prometheus exporter that compares desired/wanted IPv4/IPv6 CIDR against currently applied inbound CIDR rules in your security group(s).
Stars: ✭ 23 (-90.94%)
Mutual labels:  metrics, prometheus
java-metrics
No description or website provided.
Stars: ✭ 31 (-87.8%)
Mutual labels:  metrics, prometheus
chef-prometheus-exporters
No description or website provided.
Stars: ✭ 35 (-86.22%)
Mutual labels:  metrics, prometheus
jail exporter
A Prometheus exporter for FreeBSD jail metrics
Stars: ✭ 21 (-91.73%)
Mutual labels:  metrics, prometheus
s3 exporter
Exports Prometheus metrics about S3 buckets and objects
Stars: ✭ 65 (-74.41%)
Mutual labels:  metrics, prometheus
github exporter
Prometheus exporter for GitHub
Stars: ✭ 21 (-91.73%)
Mutual labels:  metrics, prometheus
emq exporter
Simple server that scrapes EMQ metrics and exporters them via HTTP for Prometheus consumption
Stars: ✭ 31 (-87.8%)
Mutual labels:  metrics, prometheus
chia-monitor
🍃 A comprehensive monitoring and alerting solution for the status of your Chia farmer and harvesters.
Stars: ✭ 131 (-48.43%)
Mutual labels:  metrics, prometheus
AutoMagic
A magically fast, lightweight and customizable javascript library.
Stars: ✭ 16 (-93.7%)
Mutual labels:  fast, lightweight
docker-jmx-prometheus-exporter
Dockerized jmx-exporter for prometheus
Stars: ✭ 24 (-90.55%)
Mutual labels:  metrics, prometheus
octane-exporter
Export Laravel Octane metrics using this Prometheus exporter.
Stars: ✭ 14 (-94.49%)
Mutual labels:  metrics, prometheus
selectel-exporter
No description or website provided.
Stars: ✭ 25 (-90.16%)
Mutual labels:  metrics, prometheus
gateway
A proxy to buffer and forward metrics, events, and traces.
Stars: ✭ 94 (-62.99%)
Mutual labels:  metrics, prometheus
LaravelPrometheusExporter
A laravel service provider to export metrics for prometheus.
Stars: ✭ 27 (-89.37%)
Mutual labels:  metrics, prometheus
prometheus-httpd
Expose Prometheus metrics using inets httpd.
Stars: ✭ 21 (-91.73%)
Mutual labels:  metrics, prometheus
jobflow
runs stuff in parallel (like GNU parallel, but much faster and memory-efficient)
Stars: ✭ 67 (-73.62%)
Mutual labels:  fast, lightweight
resoto
Resoto - Find leaky resources, manage quota limits, detect drift, and clean up!
Stars: ✭ 562 (+121.26%)
Mutual labels:  metrics, prometheus
druid-prometheus-exporter
Service to collect Apache Druid metrics and export them to Prometheus
Stars: ✭ 14 (-94.49%)
Mutual labels:  metrics, prometheus

Build Status GoDoc Go Report codecov

metrics - lightweight package for exporting metrics in Prometheus format

Features

  • Lightweight. Has minimal number of third-party dependencies and all these deps are small. See this article for details.
  • Easy to use. See the API docs.
  • Fast.
  • Allows exporting distinct metric sets via distinct endpoints. See Set.
  • Supports easy-to-use histograms, which just work without any tuning. Read more about VictoriaMetrics histograms at this article.

Limitations

Usage

import "github.com/VictoriaMetrics/metrics"

// Register various time series.
// Time series name may contain labels in Prometheus format - see below.
var (
	// Register counter without labels.
	requestsTotal = metrics.NewCounter("requests_total")

	// Register summary with a single label.
	requestDuration = metrics.NewSummary(`requests_duration_seconds{path="/foobar/baz"}`)

	// Register gauge with two labels.
	queueSize = metrics.NewGauge(`queue_size{queue="foobar",topic="baz"}`, func() float64 {
		return float64(foobarQueue.Len())
	})

	// Register histogram with a single label.
	responseSize = metrics.NewHistogram(`response_size{path="/foo/bar"}`)
)

// ...
func requestHandler() {
	// Increment requestTotal counter.
	requestsTotal.Inc()

	startTime := time.Now()
	processRequest()
	// Update requestDuration summary.
	requestDuration.UpdateDuration(startTime)

	// Update responseSize histogram.
	responseSize.Update(responseSize)
}

// Expose the registered metrics at `/metrics` path.
http.HandleFunc("/metrics", func(w http.ResponseWriter, req *http.Request) {
	metrics.WritePrometheus(w, true)
})

See docs for more info.

Users

FAQ

Why the metrics API isn't compatible with github.com/prometheus/client_golang?

Because the github.com/prometheus/client_golang is too complex and is hard to use.

Why the metrics.WritePrometheus doesn't expose documentation for each metric?

Because this documentation is ignored by Prometheus. The documentation is for users. Just add comments in the source code or in other suitable place explaining each metric exposed from your application.

How to implement CounterVec in metrics?

Just use GetOrCreateCounter instead of CounterVec.With. See this example for details.

Why Histogram buckets contain vmrange labels instead of le labels like in Prometheus histograms?

Buckets with vmrange labels occupy less disk space comparing to Promethes-style buckets with le labels, because vmrange buckets don't include counters for the previous ranges. VictoriaMetrics provides prometheus_buckets function, which converts vmrange buckets to Prometheus-style buckets with le labels. This is useful for building heatmaps in Grafana. Additionally, its' histogram_quantile function transparently handles histogram buckets with vmrange labels.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].