Commit graph

1175 commits

Author SHA1 Message Date
Julius Volz 00a2a93a05 Add regression tests for metrics mutations in AST.
It turned out in the end, that only drop_common_metrics() produced any
erroneous output in the old system. The second expression in the test
("sum(testmetric) keeping_extra") already worked in the old code, but
why not keep it in...

The way to test ranged evaluations is a bit clumsy so far, so I want to
build a nicer test framework in the end, where all the test cases can be
specified as text files which specify desired inputs, outputs, query
step widths, etc.

Change-Id: I821859789e69b8232bededf670a1b76e9e8c8ca4
2014-12-12 20:34:55 +01:00
Julius Volz c9618d11e8 Introduce copy-on-write for metrics in AST.
This depends on changes in:

https://github.com/prometheus/client_golang/tree/cow-metrics.

Change-Id: I80b94833a60ddf954c7cd92fd2cfbebd8dd46142
2014-12-12 20:34:55 +01:00
juliusv f2052c9c0d Merge pull request #423 from prometheus/u-c-l/adjust-to-new-goleveldb
Adjust to the new version of goleveldb.
2014-12-12 20:34:28 +01:00
Bjoern Rabenstein afd864e7f4 Adjust to the new version of goleveldb.
(And yes, we do want vendoring for that... This is just the quick fix.)

Change-Id: I9d347a64d96de6b3390a0e35c8d466f14bb83e4e
2014-12-10 18:04:29 +01:00
Björn Rabenstein cf781eff37 Merge pull request #421 from prometheus/u-c-l/code-cleanup
Apply a giant code cleanup.
2014-12-10 17:48:05 +01:00
Bjoern Rabenstein 39efe6358b Fix typos and import order.
This doesn't make the import order consistend everywhere, just where
it was touched by the previous commit.

Change-Id: I82fc75f8691da9901c7ceb808e6f6fe8e5d62c0e
2014-12-10 17:46:56 +01:00
Bjoern Rabenstein b1e4956142 Apply a giant code cleanup.
Essentially:

- Remove unused code.

- Make it 'go vet' clean. The only remaining warnings are in generated code.

- Make it 'golint' clean. The only remaining warnings are in gerenated code.

- Smoothed out same minor things.

Change-Id: I3fe5c1fbead27b0e7a9c247fee2f5a45bc2d42c6
2014-12-10 16:16:49 +01:00
Björn Rabenstein b903507371 Merge pull request #418 from prometheus/u-c-l/fix-language
Use less offensive language WRT Travis.
2014-12-09 14:46:32 +01:00
Bjoern Rabenstein 901610835b Use less offensive language WRT Travise.
Change-Id: I6cfc8a1663940283f047cfb36241ac33433ffbd4
2014-12-09 14:25:37 +01:00
Björn Rabenstein 08d4dcf223 Merge pull request #416 from prometheus/bjoern/deal-with-complicated-todos
Remove the remaining races, new and old.
2014-12-08 17:44:46 +01:00
Bjoern Rabenstein 41dbff7058 Merge branch 'master' into bjoern/deal-with-complicated-todos
Conflicts:
	README.md

Change-Id: Ia9cf8c3498ec6238669f52b4114f3db54dd0bd07
2014-12-08 17:44:18 +01:00
juliusv 8e0d7dbfd8 Update architecture diagram link in README.md. 2014-12-07 02:06:53 +01:00
Julius Volz 9c43ed7b6d Update architecture diagram.
Include links to components and include the pushgateway.

Change-Id: I8edb246fac3ba6b2f97ef0d810e0d3bf163be5f7
2014-12-07 01:58:20 +01:00
juliusv 0939e21c93 Add quotes around ARGUMENTS in README.md. 2014-12-07 01:36:12 +01:00
juliusv d769e39ea3 Fix protoc link display. 2014-12-07 01:34:56 +01:00
juliusv 05616dfa86 Use sentence-style casing in headline 2014-12-07 01:29:56 +01:00
juliusv 3df9566664 Reformat architecture overview section. 2014-12-07 01:29:13 +01:00
juliusv f1fcac724d Use rawgit.com to get correct SVG headers 2014-12-07 01:28:07 +01:00
juliusv c3922330e9 Include architecture diagram in README.md. 2014-12-07 01:23:01 +01:00
Julius Volz 6717f6b2f4 Add architecture overview diagram.
Change-Id: I860a748be534b2b9b0b60a9dd2e4436b78cc3907
2014-12-07 01:22:03 +01:00
juliusv 5b942982b7 Fix another README.md typo. 2014-12-07 00:09:09 +01:00
juliusv cc83fdc9c3 Make README.md introduction less esoteric. 2014-12-07 00:05:10 +01:00
juliusv a0457829ee Some more README.md updates. 2014-12-06 23:52:19 +01:00
juliusv c1b0237d4b Fix typo in README.md 2014-12-06 23:46:33 +01:00
Björn Rabenstein f71c215454 Merge pull request #415 from peterbourgon/fix-dockerfile
Fix Dockerfile for new repo layout
2014-12-06 13:26:32 +01:00
Bjoern Rabenstein 89bb376bce Reduce lock-protected area during scrape.
Change-Id: Iaa7faa7c916b1890b568d05bd8bfff6299b6767d
2014-12-05 19:40:41 +01:00
Peter Bourgon 88019e852a Use ENTRYPOINT and CMD 2014-12-04 20:47:17 +01:00
Bjoern Rabenstein fee88a7a77 Remove the remaining races, new and old.
Also, resolve a few other TODOs.

Change-Id: Icb39b5a5e8ca22ebcb48771cd8951c5d9e112691
2014-12-03 18:07:23 +01:00
Peter Bourgon ec4182c8c7 Remove newline at end of Dockerfile 2014-12-03 15:02:37 +01:00
Peter Bourgon dde4209144 Fix Dockerfile for new repo layout 2014-12-03 14:53:35 +01:00
Bjoern Rabenstein c0e5ac35f0 Remove spurious quotes in Makefile.INCLUDE.
Change-Id: Ic75f00e73dbfdeaa8419f5b22789fe24c84ec606
2014-11-28 16:16:29 +01:00
Bjoern Rabenstein 7c3bb145e1 Bump VERSION to 0.9.0rc1.
Change-Id: Ie1a02d026290e9ecee83990b7baa2cd730df6869
2014-11-28 16:11:49 +01:00
Björn Rabenstein ee9b32cd13 Merge pull request #413 from prometheus/cleanup/do-some-todos
Cleanup/do some todos
2014-11-28 12:53:20 +01:00
Bjoern Rabenstein 66c80b5ebd Fix typo.
Change-Id: I72608c7841c00145458807d3c3ee29db7b5ac2bc
2014-11-28 12:50:19 +01:00
Bjoern Rabenstein 674624f1c8 Completed more TODOs.
- Documented checkpoint file format.
- High-level description of series sanitation.
- Replace fp.LoadFromString panic with an error.
  (Change in client_golang already submitted.)
- Introduced checks for series file size where appropriate.
- Removed two Law of Demeter violations.

Change-Id: I555d97a2c8f4769820c2fc8bf5d6f4e160222abc
2014-11-27 20:46:45 +01:00
Bjoern Rabenstein 7d11019aa2 Squash a few trivial TODOs.
- Delete unneeded file view_adapter.go.
- Assessed that we still need the fingerprints in nodes
  (to create iterators).
- Turned numMemChunkDescs into a metric.

Change-Id: I29be963c795a075ec00c095f76bf26405535609d
2014-11-27 18:26:06 +01:00
Bjoern Rabenstein 49683c0c20 Avoid test flags in normal binary.
Change-Id: If1fba813a73bf93ea5918dcda326e3ffa81a797d
2014-11-27 18:04:48 +01:00
Bjoern Rabenstein ea86f7e8f8 Fix weird things after merge.
And I swear I'll never use 'rebase' to 'clean something up' ever agin,
even if Julius tells me to do so...

Change-Id: Ifeabab20445279bf693c95f062da769b60fe195f
2014-11-25 17:39:02 +01:00
Bjoern Rabenstein 3a17aeabfd Merge branch 'beorn/storage-ng-with-commit-history-cleaned-up'
Conflicts:
	Makefile
	Makefile.INCLUDE
	VERSION
	main.go
	notification/notification.go
	retrieval/target.go
	retrieval/target_test.go
	retrieval/targetmanager.go
	retrieval/targetmanager_test.go
	retrieval/targetpool.go
	retrieval/targetpool_test.go
	rules/ast/functions.go
	rules/rules_test.go
	storage/metric/interface.go
	storage/metric/tiered/curator.go
	storage/metric/tiered/end_to_end_test.go
	storage/metric/tiered/leveldb.go
	storage/metric/tiered/memory.go
	storage/metric/tiered/memory_test.go
	storage/metric/tiered/tiered.go
	storage/remote/queue_manager.go
	templates/templates.go
	templates/templates_test.go
	web/api/query.go
	web/consoles.go
	web/web.go

Change-Id: I96e6312b51e877d4434fe96c494e9558fe2e1d16
2014-11-25 17:36:17 +01:00
Bjoern Rabenstein 9bc05052ad Add line that has mysteriously disappeared after rebase.
Change-Id: I3612eb0b626e66e607b363e9801f187d2ba637a3
2014-11-25 17:15:56 +01:00
Julius Volz 1491fb9370 Update GeneratorURL field name in notification tests.
Change-Id: Ic4357999b6ebcf54008869a395e56d12a0ead211
2014-11-25 17:13:04 +01:00
Julius Volz af8c6df94d Eliminate modal alerts in graphing UI.
This shows errors in a pane under the expression input instead.

Change-Id: Iec209e1628a3b102cce9f34b2467621772dfb8ff
2014-11-25 17:13:04 +01:00
Julius Volz 5e8d57bec1 Make tabular view the default (vs. graphing view).
Change-Id: I9f0961f2c474e8cce5e376ce4e20040644f89370
2014-11-25 17:13:04 +01:00
Julius Volz 6eecee55b7 Fix acronym caps in GeneratorURL.
Change-Id: Ib18c1f617dcde1039e848059545a6d8831d9bf66
2014-11-25 17:13:04 +01:00
Bjoern Rabenstein 0ae1d8889a Fix tests after merge.
Change-Id: Ia90da9a3e48ed780ec38c4a6a1fd9ea34e7f6a58
2014-11-25 17:13:04 +01:00
Julius Volz b7bf11230a Add absent() function.
A common problem in Prometheus alerting is to detect when no timeseries
exist for a given metric name and label combination. Unfortunately,
Prometheus alert expressions need to be of vector type, and
"count(nonexistent_metric)" results in an empty vector, yielding no
output vector elements to base an alert on. The newly introduced
absent() function solves this issue:

  ALERT FooAbsent IF absent(foo{job="myjob"}) [...]

absent() has the following behavior:

- if the vector passed to it has any elements, it returns an empty
  vector.

- if the vector passed to it has no elements, it returns a 1-element
  vector with the value 1.

In the second case, absent() tries to be smart about deriving labels of
the 1-element output vector from the input vector:

  absent(nonexistent{job="myjob"})                   => {job="myjob"}
  absent(nonexistent{job="myjob",instance=~".*"})    => {job="myjob"}
  absent(sum(nonexistent{job="myjob"}))              => {}

That is, if the passed vector is a literal vector selector, it takes all
"=" label matchers as the basis for the output labels, but ignores all
non-equals or regex matchers. Also, if the passed vector results from a
non-selector expression, no labels can be derived.

Change-Id: I948505a1488d50265ab5692a3286bd7c8c70cd78
2014-11-25 17:13:04 +01:00
Julius Volz 3d47f94149 Drop metric names after transformations.
After many transformations, it doesn't make sense to keep the metric
names, since the result of the transformation is no longer that metric.
This drops the metric name after such transformations and makes the web
UI deal well with missing metric names.

This depends on the current branch on the following things:

- prometheus/client_golang needs to be at
  e237cf15c6
  in branch "julius/int-fingerprints" (to be merged with new storage)

- prometheus/promdash needs to be at
  dd7691c9c2

Change-Id: Ib3c8cad8d647d9854e8c653c424b8c235ccc231d
2014-11-25 17:13:04 +01:00
Bjoern Rabenstein 53c0a43754 Update README.md.
Change-Id: Ife51ed266333ff8bc228260187ea4bcf377bde31
2014-11-25 17:13:04 +01:00
Bjoern Rabenstein 14bda4180c Changes after pair code review.
Change-Id: Ib72d40f8e9027818cfbbd32a7a7201eebda07455
2014-11-25 17:12:59 +01:00
Bjoern Rabenstein a2feed343a Convert another occurrence from chan bool to chan struct{}.
Change-Id: I11ba127a934ee3aec0fcd139ad32a7751cff77a0
2014-11-25 17:10:39 +01:00