• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..16-Feb-2017-

.gitignoreH A D16-Feb-201728 21

README.mdH A D16-Feb-20171.3 KiB5442

benchmark_test.goH A D16-Feb-20173.5 KiB160135

collector.goH A D16-Feb-20173.5 KiB7617

counter.goH A D16-Feb-20175.8 KiB17692

counter_test.goH A D16-Feb-20171.7 KiB5938

desc.goH A D16-Feb-20176.7 KiB201126

doc.goH A D16-Feb-20174.6 KiB1101

example_clustermanager_test.goH A D16-Feb-20174.9 KiB13173

example_memstats_test.goH A D16-Feb-20172.8 KiB8851

example_selfcollector_test.goH A D16-Feb-20172.1 KiB6837

examples_test.goH A D16-Feb-201720.1 KiB648298

expvar.goH A D16-Feb-20174.1 KiB12062

expvar_test.goH A D16-Feb-20173.4 KiB9765

gauge.goH A D16-Feb-20174.9 KiB14873

gauge_test.goH A D16-Feb-20174.2 KiB183145

go_collector.goH A D16-Feb-20177.6 KiB264245

go_collector_test.goH A D16-Feb-20172.6 KiB124105

histogram.goH A D16-Feb-201714.1 KiB450264

histogram_test.goH A D16-Feb-20177.3 KiB327254

http.goH A D16-Feb-20178.7 KiB362268

http_test.goH A D16-Feb-20173.4 KiB12290

metric.goH A D16-Feb-20176.1 KiB16760

metric_test.goH A D16-Feb-20171.1 KiB3619

process_collector.goH A D16-Feb-20174.1 KiB143101

process_collector_test.goH A D16-Feb-20171.6 KiB5548

push.goH A D16-Feb-20172.7 KiB6622

registry.goH A D16-Feb-201723 KiB726506

registry_test.goH A D16-Feb-201714.2 KiB536493

summary.goH A D16-Feb-201716.1 KiB540318

summary_test.goH A D16-Feb-20177.6 KiB348275

untyped.goH A D16-Feb-20174.9 KiB14673

value.goH A D16-Feb-20176.7 KiB234159

vec.goH A D16-Feb-20178 KiB248131

vec_test.goH A D16-Feb-20172.9 KiB9268

README.md

1# Overview
2This is the [Prometheus](http://www.prometheus.io) telemetric
3instrumentation client [Go](http://golang.org) client library.  It
4enable authors to define process-space metrics for their servers and
5expose them through a web service interface for extraction,
6aggregation, and a whole slew of other post processing techniques.
7
8# Installing
9    $ go get github.com/prometheus/client_golang/prometheus
10
11# Example
12```go
13package main
14
15import (
16	"net/http"
17
18	"github.com/prometheus/client_golang/prometheus"
19)
20
21var (
22	indexed = prometheus.NewCounter(prometheus.CounterOpts{
23		Namespace: "my_company",
24		Subsystem: "indexer",
25		Name:      "documents_indexed",
26		Help:      "The number of documents indexed.",
27	})
28	size = prometheus.NewGauge(prometheus.GaugeOpts{
29		Namespace: "my_company",
30		Subsystem: "storage",
31		Name:      "documents_total_size_bytes",
32		Help:      "The total size of all documents in the storage.",
33	})
34)
35
36func main() {
37	http.Handle("/metrics", prometheus.Handler())
38
39	indexed.Inc()
40	size.Set(5)
41
42	http.ListenAndServe(":8080", nil)
43}
44
45func init() {
46	prometheus.MustRegister(indexed)
47	prometheus.MustRegister(size)
48}
49```
50
51# Documentation
52
53[![GoDoc](https://godoc.org/github.com/prometheus/client_golang?status.png)](https://godoc.org/github.com/prometheus/client_golang)
54