Prometheus instrumentation library for Go applications
Go to file
beorn7 606b8f85e5 - Point from Inc and Dec to Add and Sub in doc comments.
- Deprecate Untyped for direct instrumentation.

- Add a SetToCurrentTime method to Gauge

Note that adding the SetToCurrentTime method is not really following
Go's principle of lean interfaces. However, the Gauge interface is
already quite fat. (The only methods really required are Set and
Add. Everything else could be expressed in terms of those two.) So we
have already quite a few "convenience" methods traditionally, so I
think we should stay consistent here.

The alternatives would be:

- Not support SetToCurrentTime at all (it's only a SHOULD in the
  guidelines).

- A top level function `SetToCurrentTime(Gauge)`.

- Just a helper `CurrentTime()` that returns the curent unix time in
  seconds as a float (which is pretty verbose using the standard
  library, see code in this commit). This would allow
  `myGauge.Set(CurrentTime)`.

Weighing all circumstances, I believe the way in this commit is the
least evil. Issue #223 could be used to rework interfaces more
fundamentally in a breaking change if feasible.
2016-11-18 19:32:10 +01:00
api/prometheus Add goreport card and remove warnings where feasible 2016-09-16 19:59:04 +02:00
examples Adjust examples to modern usage 2016-11-12 16:36:39 +01:00
prometheus - Point from Inc and Dec to Add and Sub in doc comments. 2016-11-18 19:32:10 +01:00
.gitignore Enclose artifact generation process into Makefile. 2013-07-21 17:45:53 +02:00
.travis.yml Use go 1.6.3 2016-08-29 10:56:19 +02:00
AUTHORS.md Update AUTHORS.md 2016-11-15 18:20:25 +01:00
CHANGELOG.md Cut v0.8.0 2016-08-17 16:08:12 +02:00
CONTRIBUTING.md License cleanup 2015-01-22 16:13:15 +01:00
LICENSE License cleanup 2015-01-22 16:13:15 +01:00
NOTICE Create a public registry interface and separate out HTTP exposition 2016-08-02 18:46:22 +02:00
README.md Add goreport card and remove warnings where feasible 2016-09-16 19:59:04 +02:00
VERSION Cut v0.8.0 2016-08-17 16:08:12 +02:00

README.md

Prometheus Go client library

Build Status Go Report Card

This is the Go client library for Prometheus. It has two separate parts, one for instrumenting application code, and one for creating clients that talk to the Prometheus HTTP API.

Instrumenting applications

code-coverage go-doc

The prometheus directory contains the instrumentation library. See the best practices section of the Prometheus documentation to learn more about instrumenting applications.

The examples directory contains simple examples of instrumented code.

Client for the Prometheus HTTP API

code-coverage go-doc

The api/prometheus directory contains the client for the Prometheus HTTP API. It allows you to write Go applications that query time series data from a Prometheus server.

Where is model, extraction, and text?

The model packages has been moved to prometheus/common/model.

The extraction and text packages are now contained in prometheus/common/expfmt.

Contributing and community

See the contributing guidelines and the Community section of the homepage.