The Prometheus monitoring system and time series database.
Find a file
Matt T. Proud 1d01435d4d Make curation semaphore behavior idiomatic.
Idiomatic semaphore usage in Go, unless it is wrapping a concrete type,
should use anonymous empty structs (``struct{}``).  This has several
features that are worthwhile:

  1. It conveys that the object in the channel is likely used for
     resource limiting / semaphore use.  This is by idiom.

  2. Due to magic under the hood, empty structs have a width of zero,
     meaning they consume little space.  It is presumed that slices,
     channels, and other values of them can be represented specially
     with alternative optimizations.  Dmitry Vyukov has done
     investigations into improvements that can be made to the channel
     design and Go and concludes that there are already nice short
     circuiting behaviors at work with this type.

This is the first change of several that apply this type of change to
suitable places.

In this one change, we fix a bug in the previous revision, whereby a
semaphore can be acquired for curation and never released back for
subsequent work: http://goo.gl/70Y2qK.  Compare that versus the
compaction definition above.

On top of that, the use of the semaphore in the mode better supports
system shutdown idioms through the closing of channels.

Change-Id: Idb4fca310f26b73c9ec690bbdd4136180d14c32d
2014-04-14 22:51:58 +02:00
.build Revert "Revert "Merge pull request #317 from prometheus/fix/miekg-dns-for-srv"" 2013-09-10 17:48:05 +02:00
coding/indexable Remove some dead code. 2014-02-27 19:48:55 +01:00
config Merge "Replace some uses of obsolete /metrics.json with /metrics (haven't touched test files yet)." 2013-12-18 16:56:30 +01:00
documentation Add Java implementation links to metric model docs. 2014-02-27 15:08:44 +01:00
model Add label names -> label values index. 2014-03-28 15:16:37 +01:00
notification Fix alertmanager API path. 2014-02-19 16:05:54 +01:00
retrieval Cleanup server address handling, support IPv6. 2014-03-09 23:31:30 +01:00
rules Allow reversing vector and scalar arguments in binops. 2014-04-08 17:16:18 +02:00
stats Remove obsolete scanjobs timer. 2014-03-07 17:10:28 +01:00
storage Add regex-matching support for labels. 2014-04-01 14:24:53 +02:00
tools Fix OperatorError. 2014-01-21 16:49:51 +01:00
utility Add regex-matching support for labels. 2014-04-01 14:24:53 +02:00
web Switch to new "__name__" metric name label. 2014-03-14 16:52:37 +01:00
.gitignore More updates for first time users. 2013-10-22 20:54:43 +02:00
.pkgignore Make prometheus build on bazooka repo manager 2013-06-13 16:31:33 +02:00
.travis.yml Trailing build system cleanups. 2013-06-13 15:38:03 +02:00
build_info.go Introduce semantic versioning. 2014-03-11 15:39:22 +01:00
CONTRIBUTING.md Add note that pbcopy is only available in OSX 2013-12-03 18:06:04 +07:00
CONTRIBUTORS.md Update community documentation. 2013-03-28 10:46:41 +01:00
Dockerfile Make Dockerfile build prometheus in container 2014-02-14 11:47:47 +01:00
LICENSE Address outstanding comments from PR/47 and other cleanups. 2013-02-07 11:38:01 +01:00
main.go Make curation semaphore behavior idiomatic. 2014-04-14 22:51:58 +02:00
Makefile Introduce semantic versioning. 2014-03-11 15:39:22 +01:00
Makefile.INCLUDE Fix Mac OS X build since we upgraded to go1.2. 2014-04-14 21:16:30 +02:00
MANIFEST Add MANIFEST listing 3rd party libs and versions. 2013-04-09 13:31:56 +02:00
README.md Merge changes I53a24c06,Ibe1def5c,Ife68c9c6,Ia3284a90 2013-10-24 13:03:10 +02:00
tests-for-die-in-a-fire-travis.sh Remove gvm on travis. 2013-06-13 14:36:00 +02:00
VERSION Prometheus version 0.3.0. 2014-04-05 01:49:46 +02:00

Prometheus

Bedecke deinen Himmel, Zeus! A new kid is in town.

Prometheus is a generic time series collection and computation server that is useful in the following fields:

  • Industrial Experimentation / Real-Time Behavioral Validation / Software Release Qualification
  • Econometric and Natural Sciences
  • Operational Concerns and Monitoring

The system is designed to collect telemetry from named targets on given intervals, evaluate rule expressions, display the results, and trigger an action if some condition is observed to be true.

Prerequisites

If you read below in the Getting Started section, the build infrastructure will take care of the following things for you in most cases:

  1. Go 1.1.
  2. LevelDB: https://code.google.com/p/leveldb/.
  3. Protocol Buffers Compiler: http://code.google.com/p/protobuf/.
  4. goprotobuf: the code generator and runtime library: http://code.google.com/p/goprotobuf/.
  5. Levigo, a Go-wrapper around LevelDB's C library: https://github.com/jmhodges/levigo.
  6. GoRest, a RESTful style web-services framework: http://code.google.com/p/gorest/.
  7. Prometheus Client, Prometheus in Prometheus https://github.com/prometheus/client_golang.
  8. Snappy, a compression library for LevelDB and Levigo http://code.google.com/p/snappy/.

Getting Started

For basic help how to get started:

  • The source code is periodically indexed: Prometheus Core.
  • For UNIX-like environment users, please consult the Travis CI configuration in .travis.yml and Makefile.
  • All of the core developers are accessible via the Prometheus Developers Mailinglist.

General

For first time users, simply run the following:

$ make
$ ARGUMENTS="-configFile=documentation/examples/prometheus.conf" make run

${ARGUMENTS} is passed verbatim into the makefile and thusly Prometheus as $(ARGUMENTS). This is useful for quick one-off invocations and smoke testing.

If you run into problems, try the following:

$ SILENCE_THIRD_PARTY_BUILDS=false make

Upon having a satisfactory build, it's possible to create an artifact for end-user distribution:

$ make package
$ find build/package

build/package will be sufficient for whatever archiving mechanism you choose. The important thing to note is that Go presently does not staticly link against C dependency libraries, so including the lib directory is paramount. Providing LD_LIBRARY_PATH or DYLD_LIBRARY_PATH in a scaffolding shell script is advised.

Problems

If at any point you run into an error with the make build system in terms of its not properly scaffolding things on a given environment, please file a bug or open a pull request with your changes if you can fix it yourself.

Please note that we're explicitly shooting for stable runtime environments and not the latest-whiz bang releases; thusly, we ask you to provide ample architecture and release identification remarks for us.

Testing

$ make test

Packaging

$ make package

Race Detector

Go 1.1 includes a race detector which can be enabled at build time. Here's how to use it with Prometheus (assumes that you've already run a successful build).

To run the tests with race detection:

$ GORACE="log_path=/tmp/foo" go test -race ./...

To run the server with race detection:

$ go build -race .
$ GORACE="log_path=/tmp/foo" ./prometheus

Build Status

Contributing

Refer to CONTRIBUTING.md

License

Apache License 2.0