client_golang/prometheus
Bjoern Rabenstein 4c69ef579b Disable the timing-sensitive test TestSummaryDecay for now.
Obviously, the proper solution is to implement the test in a way that
does not depend on timing.
2014-12-18 18:05:06 +01:00
..
.gitignore Rearrange file and package per convention. 2013-04-04 15:27:09 +02:00
README.md Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
benchmark_test.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
collector.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
counter.go Added "callback" metrics, e.g. GaugeFunc. 2014-06-23 14:35:01 +02:00
counter_test.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
desc.go Make the collectorID independent of the desc order. 2014-06-26 15:50:11 +02:00
doc.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
example_clustermanager_test.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
example_memstats_test.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
example_selfcollector_test.go Added "callback" metrics, e.g. GaugeFunc. 2014-06-23 14:35:01 +02:00
examples_test.go Add pushgateway support. 2014-07-03 13:12:39 +02:00
expvar.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
expvar_test.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
gauge.go Added "callback" metrics, e.g. GaugeFunc. 2014-06-23 14:35:01 +02:00
gauge_test.go Added "callback" metrics, e.g. GaugeFunc. 2014-06-23 14:35:01 +02:00
http.go Fix a race condition in the http instrumentation. 2014-10-08 19:01:24 +02:00
http_test.go Add a configurable version of InstrumentHandler and InstrumentHandlerFunc. 2014-07-22 17:40:20 +02:00
metric.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
metric_test.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
registry.go Add missing error check. 2014-07-30 19:02:39 +02:00
registry_test.go Add a configurable version of InstrumentHandler and InstrumentHandlerFunc. 2014-07-22 17:40:20 +02:00
summary.go Vendorize perks/quantile. 2014-06-23 19:48:50 +02:00
summary_test.go Disable the timing-sensitive test TestSummaryDecay for now. 2014-12-18 18:05:06 +01:00
untyped.go Added "callback" metrics, e.g. GaugeFunc. 2014-06-23 14:35:01 +02:00
value.go Added "callback" metrics, e.g. GaugeFunc. 2014-06-23 14:35:01 +02:00
vec.go Fix typo in doc comment. 2014-09-19 13:20:59 +02:00
vec_test.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00

README.md

Overview

This is the Prometheus telemetric instrumentation client Go client library. It enable authors to define process-space metrics for their servers and expose them through a web service interface for extraction, aggregation, and a whole slew of other post processing techniques.

Installing

$ go get github.com/prometheus/client_golang/prometheus

Example

package main

import (
	"net/http"

	"github.com/prometheus/client_golang/prometheus"
)

var (
	indexed = prometheus.NewCounter(prometheus.CounterOpts{
		Namespace: "my_company",
		Subsystem: "indexer",
		Name:      "documents_indexed",
		Help:      "The number of documents indexed.",
	})
	size = prometheus.NewGauge(prometheus.GaugeOpts{
		Namespace: "my_company",
		Subsystem: "storage",
		Name:      "documents_total_size_bytes",
		Help:      "The total size of all documents in the storage."}})
)
 
func main() {
	http.Handle("/metrics", prometheus.Handler())

	indexed.Inc()
	size.Set(5)

	http.ListenAndServe(":8080", nil)
}

func init() {
	prometheus.MustRegister(indexed)
	prometheus.MustRegister(size)
}

Documentation

GoDoc