Commit Graph

175 Commits

Author SHA1 Message Date
Brian Brazil
74094947ea effect -> affect 2016-05-12 15:14:48 +01:00
Brian Brazil
68aaea618a Merge pull request #1624 from dmitris/golint
(trivial) fix several minor golint style issues
2016-05-11 14:20:19 +01:00
Fabian Reinartz
bbc4f11bcc Merge pull request #945 from msiebuhr/fuzz
Fuzz parsers
2016-05-11 14:31:31 +02:00
Dmitry Savintsev
7fdb62c253 fix several minor golint style issues 2016-05-11 14:26:18 +02:00
Morten Siebuhr
ffc8cab39a Updates fuzzers to discard less interesting data 2016-05-10 11:46:03 +02:00
Brian Brazil
ef55fd6176 Add unittest for using a metric for thresholds with group_left. 2016-05-08 16:58:23 +01:00
Morten Siebuhr
981b636004 Bring fuzzer error handling in line. 2016-04-29 22:50:24 +02:00
Morten Siebuhr
9eb2e98509 Fix up documentation + go fmt. 2016-04-29 22:50:24 +02:00
Morten Siebuhr
7371dcc787 Fuzzing corpus for ParseMetric. 2016-04-29 22:50:24 +02:00
Morten Siebuhr
5fec020b27 Initial fuzzing corpus for ParseExpr. 2016-04-29 22:50:24 +02:00
Morten Siebuhr
0ebcca5eb7 Add basic fuzzer of the parser. 2016-04-29 22:50:24 +02:00
Brian Brazil
68e70d992a Clarify error message around on(x) group_left(x) 2016-04-26 14:31:00 +01:00
Brian Brazil
7201c010c4 Rename On to MatchingLabels 2016-04-26 14:28:36 +01:00
Brian Brazil
d991f0cf47 For many-to-one matches, always copy label from one side.
This is a breaking change for everyone using the machine roles
labeling approach.
2016-04-21 19:35:41 +01:00
Brian Brazil
768d09fd2a Change on+group_* to take copy from the one side.
If the label doesn't exist on the one side, it's not copied.

All labels on the many inside are included, this is a breaking change
but likely low impact.
2016-04-21 19:35:40 +01:00
Brian Brazil
d1edfb25b3 Add support for OneToMany with IGNORING.
The labels listed in the group_ modifier will be copied from the one
side to the many side. It will be valid to specify no labels.

This is intended to replace the existing ON/GROUP_* support.,
2016-04-21 19:35:35 +01:00
Brian Brazil
1d08c4fef0 Add 'ignoring' as modifier for binops.
Where 'on' uses the given labels to match,
'ignoring' uses all other labels to match.

group_left/right is not supported yet.
2016-04-21 19:34:29 +01:00
Brian Brazil
f5084ab1c5 Add tests for group_left/group_right 2016-04-21 16:52:53 +01:00
Fabian Reinartz
fceedfa807 Add error message if old alert rule tokens are read 2016-04-16 22:25:51 +02:00
Julius Volz
6ac39700ea Fix missing printed keep_common without grouping. 2016-04-15 19:48:17 +02:00
Jonathan Boulle
38098f8c95 Add missing license headers
Prometheus is Apache 2 licensed, and most source files have the
appropriate copyright license header, but some were missing it without
apparent reason. Correct that by adding it.
2016-04-13 16:08:22 +02:00
Fabian Reinartz
9ee91062c4 Merge pull request #1522 from prometheus/unless-operator
Implement relative complement set operator "unless"
2016-04-04 21:36:17 +02:00
Tobias Schmidt
8cc86f25c0 Implement relative complement set operator "unless"
The `unless` set operator can be used to return all vector elements from
the LHS which do not match the elements on the RHS. A use case is to
return all metrics for nodes which do not have a specific role:

    node_load1 unless on(instance) chef_role{role="app"}
2016-04-04 01:29:44 -04:00
Tobias Schmidt
e82ef154ee Remove unused code leftovers 2016-04-02 20:20:55 -04:00
Tobias Schmidt
4c3dc25e35 Fix whitespace in promql test data 2016-04-02 18:25:26 -04:00
Fabian Reinartz
235e6c554b Use ContainsRune 2016-04-01 10:36:17 +02:00
Brian Brazil
24a3ad3d16 Merge pull request #1485 from eliothedeman/master
Adds holt-winters query function
2016-03-28 20:53:01 +01:00
eliothedeman
1543ef92b2 Adds holt-winters query function 2016-03-28 15:42:27 -04:00
beorn7
507f550cd4 Merge branch 'master' into beorn7/storage7 2016-03-24 14:21:28 +01:00
Brian Brazil
070d663948 Merge pull request #1501 from prometheus/and-dummy
Pull in fix for and with empty labelsets
2016-03-24 12:52:28 +00:00
Fabian Reinartz
ab3d7a0ec0 Remove old alerting syntax 2016-03-23 10:19:00 +01:00
beorn7
4b574e8a61 Switch chunk encoding to type 2 where it was hardcoded type 1 before
The chunk encoding was hardcoded there because it mostly doesn't
matter what encoding is chosen in that test. Since type 1 is
battle-hardened enough, I'm switching to type 2 here so that we can
catch unexpected problems as a byproduct. My expectation is that the
chunk encoding doesn't matter anyway, as said, but then "unexpected
problems" contains the word "unexpected".
2016-03-20 23:32:20 +01:00
Brian Brazil
8788701ce7 Add test for incorrect behaviour 2016-03-18 12:07:40 +00:00
Brian Brazil
39d556f0d5 Move all the operator tests into one file 2016-03-18 12:02:44 +00:00
beorn7
99854a84d7 Merge branch 'beorn7/storage6' into beorn7/storage7 2016-03-09 17:23:25 +01:00
beorn7
d0a4477446 Merge branch 'beorn7/storage3' into beorn7/storage4
Conflicts:
	storage/local/preload.go
	storage/local/storage.go
	storage/local/storage_test.go
2016-03-09 17:13:16 +01:00
beorn7
dad302144d Make a naked return less naked 2016-03-09 15:06:00 +01:00
beorn7
836f1db04c Improve MetricsForLabelMatchers
WIP: This needs more tests.

It now gets a from and through value, which it may opportunistically
use to optimize the retrieval. With possible future range indices,
this could be used in a very efficient way. This change merely applies
some easy checks, which should nevertheless solve the use case of
heavy rule evaluations on servers with a lot of series churn.

Idea is the following:

- Only archive series that are at least as old as the headChunkTimeout
  (which was already extremely unlikely to happen).

- Then maintain a high watermark for the last archival, i.e. no
  archived series has a sample more recent than that watermark.

- Any query that doesn't reach to a time before that watermark doesn't
  have to touch the archive index at all. (A production server at
  Soundcloud with the aforementioned series churn and heavy rule
  evaluations spends 50% of its CPU time in archive index
  lookups. Since rule evaluations usually only touch very recent
  values, most of those lookup should disappear with this change.)

- Federation with a very broad label matcher will profit from this,
  too.

As a byproduct, the un-needed MetricForFingerprint method was removed
from the Storage interface.
2016-03-09 00:25:59 +01:00
beorn7
f7fc542db6 Merge branch 'master' into beorn7/storage4
Conflicts:
	storage/local/persistence.go
2016-03-08 00:14:00 +01:00
beorn7
3d86130d8c Merge branch 'master' into beorn7/storage3 2016-03-07 23:39:12 +01:00
Björn Rabenstein
2a2cc52828 Merge pull request #1405 from prometheus/beorn7/storage
Streamline series iterator creation
2016-03-07 13:30:56 +01:00
Patrick Bogen
250344b344 use short variable assignment 2016-03-03 09:46:50 -08:00
Patrick Bogen
2062fbae0f rewrite operator balancing to be recursive 2016-03-02 15:56:40 -08:00
beorn7
0ea5801e47 Handle errors caused by data corruption more gracefully
This requires all the panic calls upon unexpected data to be converted
into errors returned. This pollute the function signatures quite
lot. Well, this is Go...

The ideas behind this are the following:

- panic only if it's a programming error. Data corruptions happen, and
  they are not programming errors.

- If we detect a data corruption, we "quarantine" the series,
  essentially removing it from the database and putting its data into
  a separate directory for forensics.

- Failure during writing to a series file is not considered corruption
  automatically. It will call setDirty, though, so that a
  crashrecovery upon the next restart will commence and check for
  that.

- Series quarantining and setDirty calls are logged and counted in
  metrics, but are hidden from the user of the interfaces in
  interface.go, whith the notable exception of Append(). The reasoning
  is that we treat corruption by removing the corrupted series, i.e. a
  query for it will return no results on its next call anyway, so
  return no results right now. In the case of Append(), we want to
  tell the user that no data has been appended, though.

Minor side effects:

- Now consistently using filepath.* instead of path.*.

- Introduced structured logging where I touched it. This makes things
  less consistent, but a complete change to structured logging would
  be out of scope for this PR.
2016-03-02 23:02:34 +01:00
beorn7
8766f99085 Merge branch 'beorn7/storage2' into beorn7/storage3 2016-03-02 23:02:06 +01:00
beorn7
162f6fa6f6 Merge branch 'beorn7/storage' into beorn7/storage2 2016-03-02 23:01:26 +01:00
beorn7
79a2ae2d2e Add missing test file 2016-03-02 23:00:23 +01:00
beorn7
b6840997a7 Merge branch 'beorn7/storage2' into beorn7/storage3 2016-03-02 16:11:25 +01:00
beorn7
ce58fd357b Merge branch 'beorn7/storage' into beorn7/storage2
Conflicts:
	storage/local/chunk.go
	storage/local/interface.go
2016-03-02 16:09:32 +01:00
beorn7
2581648f70 Separate iterators by offset
Add test that exposes the problem.
2016-03-02 16:01:03 +01:00