1
0
Fork 0
mirror of https://github.com/Luzifer/elb-instance-status.git synced 2024-11-08 22:10:06 +00:00
elb-instance-status/vendor/github.com/prometheus/client_golang/prometheus
2016-06-06 18:06:39 +02:00
..
.gitignore Vendored dependencies 2016-06-06 18:06:39 +02:00
collector.go Vendored dependencies 2016-06-06 18:06:39 +02:00
counter.go Vendored dependencies 2016-06-06 18:06:39 +02:00
desc.go Vendored dependencies 2016-06-06 18:06:39 +02:00
doc.go Vendored dependencies 2016-06-06 18:06:39 +02:00
expvar.go Vendored dependencies 2016-06-06 18:06:39 +02:00
gauge.go Vendored dependencies 2016-06-06 18:06:39 +02:00
go_collector.go Vendored dependencies 2016-06-06 18:06:39 +02:00
histogram.go Vendored dependencies 2016-06-06 18:06:39 +02:00
http.go Vendored dependencies 2016-06-06 18:06:39 +02:00
metric.go Vendored dependencies 2016-06-06 18:06:39 +02:00
process_collector.go Vendored dependencies 2016-06-06 18:06:39 +02:00
push.go Vendored dependencies 2016-06-06 18:06:39 +02:00
README.md Vendored dependencies 2016-06-06 18:06:39 +02:00
registry.go Vendored dependencies 2016-06-06 18:06:39 +02:00
summary.go Vendored dependencies 2016-06-06 18:06:39 +02:00
untyped.go Vendored dependencies 2016-06-06 18:06:39 +02:00
value.go Vendored dependencies 2016-06-06 18:06:39 +02:00
vec.go Vendored dependencies 2016-06-06 18:06:39 +02: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