clair/contrib/analyze-local-images/vendor/github.com/prometheus/client_golang/prometheus
2016-03-17 15:53:33 -04:00
..
.gitignore contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
collector.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
counter.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
desc.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
doc.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
expvar.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
fnv.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
gauge.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
go_collector.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
histogram.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
http.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
metric.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
process_collector.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
push.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
README.md contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
registry.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
summary.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
untyped.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
value.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00
vec.go contrib: Add vendors to analyze-local-images 2016-03-17 15:53:33 -04:00

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