Commit Graph

686 Commits

Author SHA1 Message Date
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
Björn Rabenstein 0c3fb9f355 Merge pull request #37 from prometheus/cow-metrics
Add COWMetric and do some code cleanups.
2014-12-15 16:18:53 +01:00
Julius Volz c7779ab9ec Add COWMetric and do some code cleanups. 2014-12-12 20:57:05 +01:00
Björn Rabenstein 27edbd47b3 Merge pull request #35 from prometheus/u-c-l/maintenance
Just a couple of minor things maintenance.
2014-12-08 17:50:40 +01:00
Bjoern Rabenstein 29347ab2a9 Add a few trailing commas to tests.
That is to prove that trailing commas work for the processor.

Change-Id: Ibecac811d47958387c9633df69bafbe284cf0b8f
2014-12-05 14:23:03 +01:00
Bjoern Rabenstein d0daf681d6 Make extraction honor ms-precision timestamps.
The test touched by this commit exposed the bug already.

Change-Id: I303131eab841ae0ea9b1a727230e68754a4cd8fe
2014-12-05 14:21:13 +01:00
Bjoern Rabenstein 5ae6e57c4c Update the vendoring of bmizerany/perks/quantile.
This is still from my own fork as there are still critical PRs that
bmizerany hasn't responded to yet.

Change-Id: Ib46e68ec9ecbae9423b1bfe1311569426dfc7ba0
2014-12-05 13:51:24 +01:00
Bjoern Rabenstein 115bde9c47 Delete MustLoadFromString, as nobody needs it.
Change-Id: Ib95c316857ffdd36d973c0e8701967de99d78b13
2014-11-27 19:32:42 +01:00
Bjoern Rabenstein bfd70e3280 Make LoadFromString not panic but return an error instead.
Change-Id: I9f52fe807c8e9771a530f90ede8bd46fcdb467ae
2014-11-27 19:29:17 +01:00
Julius Volz 87a585def8 Adjust various things required for the new storage backend.
- Change Fingerprints to be simple uint64s.
- Deal sensibly with missing metric names.
- Enable finer-grained time resolution.

Merge this concurrently with the merge of the new storage backend into
prometheus/prometheus.

Change-Id: Idd82f137aa0c4286df422c53ce3c62e0de285360
2014-11-24 19:56:40 +01:00
Bjoern Rabenstein c53c07a719 Tolerate MetricFamily with unset type.
In that case, the default value is chosen (COUNTER for historical
reasons.)

Change-Id: I8f3384feee7f3bbaa837b216b0885ad238d1e0e5
2014-11-05 13:05:06 +01:00
Bjoern Rabenstein f4be228ba0 Fix a race condition in the http instrumentation.
computeApproximateRequestSize is run in a goroutine, but the
handlerFunc that runs in parallel may modify the URL, which is also
needed by computeApproximateRequestSize. So get the URL length
beforehand.

Change-Id: Idb84735845afe7be4ef79b3d642d5764f6d26a7c
2014-10-08 19:01:24 +02:00
Bjoern Rabenstein 6fbc8ef5c2 Fix typo in doc comment.
Change-Id: Ifa40feb83e89b60b8e3efea298264d91f3758ecb
2014-09-19 13:20:59 +02:00
Bjoern Rabenstein b09d588309 Add missing error check.
Change-Id: I6fcf6d5d50333ff0c205fd87cdb9430f1bc02c43
2014-07-30 19:02:39 +02:00
Bjoern Rabenstein 96297bcbae Add a configurable version of InstrumentHandler and InstrumentHandlerFunc.
Also, remove quotes from the Content-type header. It's not illegal to
have quotes there, but they are not needed, and at other places, we
are not using them. So fewer characters and more consistency.

Change-Id: If7a78bde85154163e4426daec493d973213e83e9
2014-07-22 17:40:20 +02:00
Bjoern Rabenstein 23e5e5fefd Add gzip support.
Change-Id: I6ea6e0dcbe7234ad143403d262da6cb40e7d3b50
2014-07-04 17:08:57 +02:00
Bjoern Rabenstein 457bc47eac Merge "Add Content-Length header." 2014-07-03 14:47:11 +02:00
Bjoern Rabenstein c21d91ceb9 Merge "Add pushgateway support." 2014-07-03 14:46:54 +02:00
Bjoern Rabenstein 5ac9f00fa9 Add Content-Length header.
Since we prepare the whole content in a buf before sending, we can as
well set the Content-Length explicitly.

Change-Id: Ifd91764c90af53be49f93f0b33032138130b6f96
2014-07-03 13:12:39 +02:00
Bjoern Rabenstein 0afe1a813e Add pushgateway support.
Change-Id: I4730b150ac84ae38939b16effaf4b2ad4afa5bc0
2014-07-03 13:12:39 +02:00
Bjoern Rabenstein e1342a3d39 Merge branch 'next'.
This flips the switch to the rewritten client_golang/prometheus.

Change-Id: Ic15aba39523636615103b3105cf3a65d40d7d3b1
2014-06-30 15:42:22 +02:00
Bjoern Rabenstein 998774096c Make the collectorID independent of the desc order.
This is actually the intended behavior, and (as a nice side effect)
makes things cheaper to calculate.

Also, introduce a separator character to avoid hash collisions
(like label values {"ab","c"} vs {"a", "bc"}).

Apply the same principles to signature.go.

Change-Id: I607db544f278ed89684fe5fa11abdbc3e03d3061
2014-06-26 15:50:11 +02:00
Bjoern Rabenstein 010dc1af88 Vendorize perks/quantile.
Change-Id: I2b24bddf5a975a46ceb598db328c317982154466
2014-06-23 19:48:50 +02:00
Bjoern Rabenstein f9401ffab9 Added "callback" metrics, e.g. GaugeFunc.
Change-Id: I449b558207963ce60572bd04c8102f1db684dd4c
2014-06-23 14:35:01 +02:00
Bjoern Rabenstein 5122dc6cc0 Fix doc comment typo.
Change-Id: I19b4b553b01823da0c1015d779f1f05b2c2cfb5b
2014-06-23 11:45:49 +02:00
Bjoern Rabenstein 8234d12ed0 Add InstrumentHandlerFunc.
Also, fix seconds to microseconds fot the http instrumentation to
match the metric name.

Fix Desc.String().

Simplify http error display.

Change-Id: Ib7397f4eac1eeed92b291e1c9cc88c080aee99ca
2014-06-20 20:57:27 +02:00
Bjoern Rabenstein 5d40912fd2 Complete rewrite of the exposition library.
This rewrite had may backs and forths. In my git repository, it
consists of 35 commits which I cannot group or merge into reasonable
review buckets. Gerrit breaks fundamental git semantics, so I have to
squash the 35 commits into one for the review.

I'll push this not with refs/for/master, but with refs/for/next so
that we can transition after submission in a controlled fashion.

For the review, I recommend to start with looking at godoc and in
particular the many examples. After that, continue with a line-by-line
detailed review. (The big picture is hopefully as expected after
wrapping up the discussion earlier.)

Change-Id: Ib38cc46493a5139ca29d84020650929d94cac850
2014-06-17 14:08:22 +02:00
Bjoern Rabenstein d3ebb29141 Fix escaping even more.
Change-Id: Ie958d557aae0dda68c451e9fafc615221cc07bb0
2014-05-15 12:49:39 +02:00
Bjoern Rabenstein 82e55cd560 Fix docstring escaping.
Change-Id: Ib8c8658795c9e2b0fa1a9321d7cbdef7ad4f2745
2014-05-14 18:46:58 +02:00
Bjoern Rabenstein 44926efd85 Fix typo.
Change-Id: I1b28a0f232e88b79bc34a458c115bcf74e978284
2014-05-14 14:51:12 +02:00