client_golang/prometheus
Bjoern Rabenstein 5d40912fd2 Complete rewrite of the exposition library.
This rewrite had may backs and forths. In my git repository, it
consists of 35 commits which I cannot group or merge into reasonable
review buckets. Gerrit breaks fundamental git semantics, so I have to
squash the 35 commits into one for the review.

I'll push this not with refs/for/master, but with refs/for/next so
that we can transition after submission in a controlled fashion.

For the review, I recommend to start with looking at godoc and in
particular the many examples. After that, continue with a line-by-line
detailed review. (The big picture is hopefully as expected after
wrapping up the discussion earlier.)

Change-Id: Ib38cc46493a5139ca29d84020650929d94cac850
2014-06-17 14:08:22 +02: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 Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
counter_test.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
desc.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +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 Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
examples_test.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +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 Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
gauge_test.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
http.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
http_test.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +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 Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
registry_test.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
summary.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
summary_test.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
untyped.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
value.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +02:00
vec.go Complete rewrite of the exposition library. 2014-06-17 14:08:22 +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