Commit Graph

715 Commits

Author SHA1 Message Date
Tobias Schmidt d1d9dee31b Remove dependency on procfs/cgo in non-procfs systems
The procfs package has a cgo dependency (necessary to calculate system
times). As procfs is not available under windows, darwin and supposely
all newer BSD systems, this change remove the procfs dependency on these
systems.
2015-02-02 15:40:04 -05:00
Tobias Schmidt 728064bb68 Merge pull request #66 from prometheus/process-collector-explicit-error-interface
Use clear error interface for process pidFn
2015-02-02 15:06:09 -05:00
Tobias Schmidt 3cb16a9503 Use clear error interface for process pidFn
If a given pidFn for a process collector can't determine the pid, this
had to be signaled with an invalid pid so far (pid <= 0). In order to
make the error interface clearer for users, this change introduces an
explicit error parameter.
2015-02-02 14:59:24 -05:00
Björn Rabenstein babc844741 Merge pull request #64 from prometheus/beorn7/performance
Improve Gauge and Counter performance.
2015-02-02 18:51:05 +01:00
beorn7 4f73a8b017 Improve Gauge and Counter performance.
This is accomplished by using the functions from the atomic packages
instead of a mutex.

benchmark                                      old ns/op     new ns/op     delta
BenchmarkGaugeNoLabels-2                       118           9.40          -92.03%
BenchmarkGaugeNoLabels                         117           9.38          -91.98%
BenchmarkGaugeNoLabels-4                       117           9.40          -91.97%
BenchmarkCounterNoLabels-2                     137           16.8          -87.74%
BenchmarkCounterNoLabels                       136           16.8          -87.65%
BenchmarkCounterNoLabels-4                     136           16.8          -87.65%
BenchmarkGaugeWithLabelValues-4                400           279           -30.25%
BenchmarkGaugeWithLabelValues-2                398           279           -29.90%
BenchmarkGaugeWithLabelValues                  400           283           -29.25%
BenchmarkCounterWithLabelValues-4              397           286           -27.96%
BenchmarkCounterWithLabelValues-2              396           286           -27.78%
BenchmarkCounterWithLabelValues                394           285           -27.66%
BenchmarkCounterWithPreparedMappedLabels       587           454           -22.66%
BenchmarkCounterWithPreparedMappedLabels-2     581           456           -21.51%
BenchmarkCounterWithPreparedMappedLabels-4     654           539           -17.58%
BenchmarkCounterWithMappedLabels-2             1441          1218          -15.48%
BenchmarkCounterWithMappedLabels               1099          963           -12.37%
BenchmarkCounterWithMappedLabels-4             1636          1501          -8.25%
2015-02-02 18:11:11 +01:00
Björn Rabenstein 88b6ea5852 Merge pull request #63 from prometheus/beorn7/versioning
Introduce versioning and clean up the headers.
2015-02-02 15:33:45 +01:00
Bjoern Rabenstein b0107f53ac Added CHANGELOG.md and VERSION. 2015-02-02 15:25:18 +01:00
Bjoern Rabenstein d7f8eb1083 Change "Prometheus Team" to "The Prometheus Authors". 2015-02-02 15:14:36 +01:00
Björn Rabenstein aa1328d02c Merge pull request #62 from prometheus/fix-writepb-race
Fix race condition in writePB().
2015-01-31 23:52:10 +01:00
Julius Volz f3e101bd1c Fix race condition in writePB().
The RLock already needs to be acquired when reading r.dimHashesByName.

This fixes https://github.com/prometheus/client_golang/issues/61
2015-01-31 22:10:27 +01:00
Björn Rabenstein e192dfc497 Merge pull request #60 from prometheus/beorn7/fix-const-labels
Add const labels to counter.
2015-01-28 15:59:29 +01:00
Bjoern Rabenstein 3798bbca12 Add const labels to counter. 2015-01-28 15:47:48 +01:00
Björn Rabenstein 80ad13d35e Merge pull request #53 from prometheus/beorn7/benchmark
Add benchmarks to compare text and protobuf parsing.
2015-01-27 18:15:20 +01:00
Bjoern Rabenstein 4092aaec40 Fix typos. 2015-01-27 18:07:09 +01:00
Bjoern Rabenstein b2128904e2 Add BenchmarkProcessor002ParseOnly, to get at least a hint of the JSON speed. 2015-01-27 17:16:23 +01:00
Bjoern Rabenstein 849d859db4 Add benchmarks to compare text and protobuf parsing. 2015-01-27 16:27:04 +01:00
juliusv 283d371002 Merge pull request #51 from prometheus/sample-formatting
Better sample value string formatting.
2015-01-26 01:41:16 +01:00
juliusv 000337ccc0 Merge pull request #52 from brian-brazil/make-example
Make examples buildable from make
2015-01-26 01:30:49 +01:00
Brian Brazil 5a2ed875a6 Make examples buildable from make 2015-01-26 00:19:15 +00:00
Julius Volz 4a842c5da0 Better sample value string formatting.
This forces a float format without exponent that uses the minimum number
of digits necessary to display a given sample value.
2015-01-25 23:52:46 +01:00
juliusv 316b327693 Merge pull request #50 from prometheus/beorn7/license-cleanup
License cleanup
2015-01-22 17:11:32 +01:00
juliusv 3713bd7d97 Merge pull request #48 from prometheus/beorn7/fix-summary-dimensions
Beorn7/fix summary dimensions
2015-01-22 17:03:39 +01:00
Bjoern Rabenstein 3706852780 License cleanup 2015-01-22 16:13:15 +01:00
Björn Rabenstein d5fe8ed656 Merge pull request #49 from prometheus/beorn7/fix-summaries
Beorn7/fix summaries
2015-01-21 16:42:22 +01:00
Bjoern Rabenstein 31b6c1fe12 Make number notation consistent. 2015-01-21 15:24:34 +01:00
Bjoern Rabenstein 15c9ded5a3 Fix the summary decay by avoiding the Merge method.
This makes the Observe method of summaries more expensive. :-(
2015-01-21 13:44:43 +01:00
Bjoern Rabenstein 6b9530d72e Update vendoring of perks to newest (fixed) version.
Adjust the API and usage accordingly.
Make tests stricter.

Since the merging is still faulty, test are broken now.
The next commit will fix it by avoiding merging.
2015-01-20 18:27:10 +01:00
Bjoern Rabenstein 26e2417d3e Quick-fix the doc comment. 2015-01-13 17:26:38 +01:00
Bjoern Rabenstein 5c6a472617 Merge branch 'beorn7/allow-collect-errors' into beorn7/fix-summary-dimensions 2015-01-13 16:54:12 +01:00
Björn Rabenstein aa848f77db Merge pull request #45 from prometheus/beorn7/allow-collect-errors
Allow error reporting during metrics collection and simplify Register().
2015-01-13 16:53:16 +01:00
Bjoern Rabenstein dd4e57186a Improve doc comment for Describe. 2015-01-13 16:52:42 +01:00
Bjoern Rabenstein 05059724f8 Remove the partition of summaries by HTTP status code and method.
Summaries as implemented cannot be aggregated in a meaningful
way. Partitoning them by status code and method only made sense if we
were interested in the individual latency and size of e.g. GET request
that result in status 503. In general, that's not the case. Most of
the time, the user will be interested in the latency and size of _all_
HTTP requests.

(With future changes to client_golang, we will consider making the
HTTP instrumentation configurable, e.g. to handle the case where the
user is only interested in the latency of successful requests.)
2015-01-13 14:57:37 +01:00
Bjoern Rabenstein 159e96f6c7 Allow error reporting during metrics collection and simplify Register().
Both are interface changes I want to get in before public
announcement. They only break rare usage cases, and are always easy to
fix, but still we want to avoid breaking changes after a wider
announcement of the project.

The change of Register() simply removes the return of the Collector,
which nobody was using in practice. It was just bloating the call
syntax. Note that this is different from RegisterOrGet(), which is
used at various occasions where you want to register something that
might or might not be registered already, but if it is, you want the
previously registered Collector back (because that's the relevant
one).

WRT error reporting: I first tried the obvious way of letting the
Collector methods Describe() and Collect() return error. However, I
had to conclude that that bloated _many_ calls and their handling in
very obnoxious ways. On the other hand, the case where you actually
want to report errors during registration or collection is very
rare. Hence, this approach has the wrong trade-off. The approach taken
here might at first appear clunky but is in practice quite handy,
mostly because there is almost no change for the "normal" case of "no
special error handling", but also because it plays well with the way
descriptors and metrics are handled (via channels).

Explaining the approach in more detail:

- During registration / describe: Error handling was actually already
  in place (for invalid descriptors, which carry an error anyway). I
  only added a convenience function to create an invalid descriptor
  with a given error on purpose.

- Metrics are now treated in a similar way. The Write method returns
  an error now (the only change in interface). An "invalid metric" is
  provided that can be sent via the channel to signal that that metric
  could not be collected. It alse transports an error.

NON-GOALS OF THIS COMMIT:

This is NOT yet the major improvement of the whole registry part,
where we want a public Registry interface and plenty of modular
configurations (for error handling, various auto-metrics, http
instrumentation, testing, ...). However, we can do that whole thing
without breaking existing interfaces. For now (which is a significant
issue) any error during collection will either cause a 500 HTTP
response or a panic (depending on registry config). Later, we
definitely want to have a possibility to skip (and only report
somehow) non-collectible metrics instead of aborting the whole scrape.
2015-01-12 19:16:09 +01:00
Jeff Younker af0ec0d3f1 Merge pull request #44 from prometheus/small-13-compat-fix
Remove a Go 1.4ism to allow compilation under Go 1.3.
2015-01-09 15:38:52 +01:00
Jeff Younker 014d4bd173 Remove a Go 1.4ism to allow compilation under Go 1.3. 2015-01-09 14:52:23 +01:00
juliusv d7f000b100 Merge pull request #43 from prometheus/remove-extraction-result-type
Remove extraction result type, simplify code.
2015-01-08 17:51:51 +01:00
juliusv d1beff1523 Merge pull request #42 from prometheus/interesting-examples
Make random example more interesting.
2015-01-06 18:28:16 +01:00
Julius Volz eb24b39865 Make random example more interesting.
Have different RPC rates for the three services and vary them according
to a diurnal period.
2015-01-06 18:19:44 +01:00
juliusv 300983df4b Merge pull request #41 from prometheus/readd-examples
Re-add some simple example binaries.
2015-01-06 15:48:45 +01:00
Julius Volz 06f26c5fa8 Re-add some simple example binaries.
I intentionally left out the Makefile infrastructure that we had
previously for this, as it's not strictly needed and adds
complexity/maintenance burden.
2015-01-06 15:41:10 +01:00
Julius Volz 0bb9a56250 Remove extraction result type, simplify code. 2014-12-31 13:53:17 +01:00
Tobias Schmidt 376c7c732b Merge pull request #36 from prometheus/standard-exports
Standard exports
2014-12-22 14:00:18 -05:00
Tobias Schmidt d66557ae59 Register process and go collectors by default 2014-12-22 13:55:44 -05:00
Tobias Schmidt dbd48d666b Add ProcessCollector and GoCollector
This change adds two new collectors to the prometheus package which
export metrics about a given or the current process.

* ProcessCollector exports metrics about cpu time, vss, rss, fd usage as
  well as the start time of a given process.
* GoCollector exports currently only the number of active goroutines.
2014-12-22 13:49:45 -05:00
juliusv 2657498a2f Merge pull request #40 from prometheus/drain-collect-channel
Drain collector channel when returning prematurely.
2014-12-19 14:22:52 +01:00
Julius Volz 7fcb2c594a Drain collector channel when returning prematurely. 2014-12-19 14:18:55 +01:00
Julius Volz deef44ca73 Update used Go version from 1.2.1 to 1.4. 2014-12-19 14:18:46 +01:00
Julius Volz c2ed40c71c Update Go download path and enable curl redirects. 2014-12-19 14:18:46 +01:00
Tobias Schmidt 0342a9f0c7 Merge pull request #39 from prometheus/beorn7/fix-travis
Disable the timing-sensitive test TestSummaryDecay for now.
2014-12-18 14:05:26 -05:00
Bjoern Rabenstein 4c69ef579b Disable the timing-sensitive test TestSummaryDecay for now.
Obviously, the proper solution is to implement the test in a way that
does not depend on timing.
2014-12-18 18:05:06 +01:00