Anthony Romano b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
..
.gitignore b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
README.md b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
collector.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
counter.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
desc.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
doc.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
expvar.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
gauge.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
go_collector.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
histogram.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
http.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
metric.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
process_collector.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
push.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
registry.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
summary.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
untyped.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
value.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
vec.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago

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