client_golang/prometheus
Julius Volz 169c8a68e1 Use godep with import rewriting for vendoring.
The new vendoring was produced by running:

    godep save -r ./examples/... ./prometheus/... ./text/... ./model/... ./extraction/...

Two things to note:

- "extraction/processor0_0_{1,2}_test.go" imported a package from
  "github.com/prometheus/prometheus", all for just one tiny testing
  function. To not have to deal with a circular vendoring dependency, I
  simply replaced the usage of the function by some in-line logic.

- godep grouped the rewritten imports slightly differently for some
  reason, but at least the standard library imports are still in a
  separate section. Not sure if it's worth manually keeping our old
  import grouping scheme or if we should simply use that godep-generated
  one.
2015-02-26 00:47:03 +01:00
..
.gitignore Rearrange file and package per convention. 2013-04-04 15:27:09 +02:00
README.md Fix document 2015-02-11 17:35:04 -05:00
benchmark_test.go Add support for histograms to the Go client library. 2015-02-19 15:54:26 +01:00
collector.go Change "Prometheus Team" to "The Prometheus Authors". 2015-02-02 15:14:36 +01:00
counter.go Replaced http by HTTP if used as the name of the protocol in English. 2015-02-19 15:54:26 +01:00
counter_test.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
desc.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
doc.go Change "Prometheus Team" to "The Prometheus Authors". 2015-02-02 15:14:36 +01:00
example_clustermanager_test.go Change "Prometheus Team" to "The Prometheus Authors". 2015-02-02 15:14:36 +01:00
example_memstats_test.go Change "Prometheus Team" to "The Prometheus Authors". 2015-02-02 15:14:36 +01:00
example_selfcollector_test.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
examples_test.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
expvar.go Change "Prometheus Team" to "The Prometheus Authors". 2015-02-02 15:14:36 +01:00
expvar_test.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
gauge.go Change "Prometheus Team" to "The Prometheus Authors". 2015-02-02 15:14:36 +01:00
gauge_test.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
go_collector.go Add ProcessCollector and GoCollector 2014-12-22 13:49:45 -05:00
go_collector_test.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
histogram.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
histogram_test.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
http.go Replaced http by HTTP if used as the name of the protocol in English. 2015-02-19 15:54:26 +01:00
http_test.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
metric.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
metric_test.go Change "Prometheus Team" to "The Prometheus Authors". 2015-02-02 15:14:36 +01:00
process_collector.go Remove dependency on procfs/cgo in non-procfs systems 2015-02-02 15:40:04 -05:00
process_collector_procfs.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
process_collector_rest.go Remove procfs dependency unless cgo is enabled 2015-02-09 16:38:04 +01:00
process_collector_test.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
registry.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
registry_test.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
summary.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
summary_test.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
untyped.go Change "Prometheus Team" to "The Prometheus Authors". 2015-02-02 15:14:36 +01:00
value.go Use godep with import rewriting for vendoring. 2015-02-26 00:47:03 +01:00
vec.go Change "Prometheus Team" to "The Prometheus Authors". 2015-02-02 15:14:36 +01:00
vec_test.go Change "Prometheus Team" to "The Prometheus Authors". 2015-02-02 15:14:36 +01: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