Commit Graph

67 Commits

Author SHA1 Message Date
Brian Brazil
296f551418 Merge pull request #1014 from prometheus/scalar-rules
rules: Allow recorded rules expressions to be scalars.
2015-08-19 22:10:49 +01:00
Brian Brazil
e6a67476c2 rules: Allow recorded rules expressions to be scalars.
This is useful if you want to build up a constant metric,
such as a set of alert thresholds that vary by label value.
2015-08-19 21:09:00 +01:00
Laurie Malau
cdf38ab93a Log runtime errors during query evaluation instead of panicking. 2015-08-19 16:56:41 +02:00
Julius Volz
27ed874358 Implement label_replace()
Implements part of https://github.com/prometheus/prometheus/issues/959.
2015-08-18 14:20:07 +02:00
Fabian Reinartz
690b5f1575 Remove multi-statement queries
This commit removes the possibility to have multi-statement queries
which had no full support anyway. This makes the caller responsible
for multi-statement semantics.
Multiple tests are no longer timing-dependent.
2015-08-10 14:26:20 +02:00
Julius Volz
e324910ff2 Merge pull request #936 from prometheus/predict
promql: Add support for predict(my_timeseries[1h], 2h)
2015-08-05 16:40:51 +02:00
Brian Brazil
d6a80c2b76 promql: Add support for predict_linear(my_timeseries[1h], 7200)
This will give a prediction for the value of my_timeseries in 2 hours,
based on the last hour of data.
2015-08-05 15:16:49 +01:00
Fabian Reinartz
579fdf65e2 Implement unary expression for vector types.
Closes #956
2015-08-04 15:46:36 +02:00
Fabian Reinartz
c322422412 Merge pull request #954 from prometheus/fabxc/fuzz-fix
Add missing check for nil expression
2015-08-03 16:48:20 +02:00
Fabian Reinartz
adf109795c forbid unexpected (runtime) errors in parse tests 2015-08-03 12:53:31 +02:00
Fabian Reinartz
c20e25f718 Add missing check for nil expression 2015-08-03 12:28:40 +02:00
Brian Brazil
a0f0b82348 promql: Test errors aren't always ParseErr 2015-08-02 23:26:21 +01:00
Fabian Reinartz
5279d50d92 Handle parser runtime panics gracefully 2015-08-02 13:42:18 +02:00
Julius Volz
4e4b468fba Fix lexer bug treating non-Latin Unicode digits as digits.
Fixes https://github.com/prometheus/prometheus/issues/939
2015-07-29 02:11:13 +02:00
Fabian Reinartz
3d67d75935 promql: implement JSON array format for scalar and string 2015-07-06 13:09:26 +02:00
Fabian Reinartz
77e8983221 promql: add MarshalJSON method for SamplePair 2015-07-06 10:29:59 +02:00
Fabian Reinartz
c1d37bc55b Merge pull request #843 from prometheus/fabxc/runbook
promql: add runbook to alert statement.
2015-06-25 14:07:45 +02:00
Fabian Reinartz
70d7a987a7 promql: add json tags, fix query constructor. 2015-06-25 13:44:05 +02:00
Fabian Reinartz
749ae450c5 promql: add runbook to alert statement.
This commit adds the RUNBOOK keyword to alert statements. The field
is optional and expected to be a link.
2015-06-25 13:00:52 +02:00
Fabian Reinartz
7f85b9b215 promql: add MarshalJSON method for ExprType. 2015-06-25 12:01:26 +02:00
Fabian Reinartz
1eff186555 Merge pull request #810 from prometheus/fabxc/lmatch
Match empty labels.
2015-06-22 15:45:50 +02:00
Fabian Reinartz
5b91ea9b36 storage: improve label matching and allow unset matching.
Matching of empty labels now also matches metrics where the label
was not explicitly set to the empty string.
2015-06-22 15:33:44 +02:00
Fabian Reinartz
94cd321be1 promql: error if all label matchers are empty. 2015-06-22 15:33:44 +02:00
Fabian Reinartz
fe301d7946 promql: remove global flags 2015-06-15 19:01:06 +02:00
Julius Volz
5e2d1c1464 Deprecate keeping_extra, rename it to keep_common.
`keep_common` is more in line with the function name
`drop_common_labels()` terminology-wise, and also more in line with
`group_left`/`group_right` (no `...ing` verb suffix).

We could also go the full way and call it `keep_common_labels`. That
would have the benefit of being even more consistent with the function
`drop_common_labels()` and would be more explanatory, but it also seems
quite long.
2015-06-12 14:21:05 +02:00
Fabian Reinartz
e7659f908c promql: remove DotGraph methods from nodes. 2015-06-12 09:48:14 +02:00
Fabian Reinartz
c716d8a47b promql: fix aggregation expression String() method.
Fixes #794.
2015-06-12 09:48:01 +02:00
Fabian Reinartz
c32ae22119 promql: fix missing metric in range results. 2015-06-11 23:50:53 +02:00
Fabian Reinartz
0acd44b0e3 promql: expose ParseMetric and ParseMetricSelector 2015-06-11 12:22:11 +02:00
Fabian Reinartz
cb10ceac18 promql: allow scalar expressions in range queries, improve errors.
These changes allow to do range queries over scalar expressions.
Errors on bad types for range queries are now raised on query creation
rather than evaluation.
2015-06-10 18:36:02 +02:00
Fabian Reinartz
ab9c98acac web/api: add initial API v1 implementation. 2015-06-06 21:47:36 +02:00
Fabian Reinartz
03b737322e promql: expose storage and query engine for tests 2015-06-04 19:00:22 +02:00
Fabian Reinartz
319068a7a6 promql: fix parsing ambiguity for serial repetitions 2015-06-04 19:00:22 +02:00
Fabian Reinartz
c60e3387ef promql: fix lexing of \r as whitespaces 2015-06-02 18:33:49 +02:00
Fabian Reinartz
0de6edbdfc Move pkg/ to util/ 2015-06-01 21:12:32 +02:00
Fabian Reinartz
dbc0d30e3e Move string functionality to pkg/strutil 2015-06-01 21:12:32 +02:00
Fabian Reinartz
ccf51b132e Move stats package to pkg/stats 2015-06-01 21:12:31 +02:00
Fabian Reinartz
3c8fbf1e15 Move test package to pkg/testutil 2015-06-01 21:12:31 +02:00
Brian Brazil
f34de493d5 Add increase() function, to replace delta(..., 1).
This calculates how much a counter increases over
a given period of time, which is the area under the curve
of it's rate.

increase(x[5m]) is equivilent to rate(x[5m]) * 300.
2015-05-26 22:49:21 +01:00
Julius Volz
d44a89c6e8 Implement changes() function.
changes() takes a range vector and returns the number of times a value
has changed in the given time window for each time series as an instant
vector.
2015-05-26 19:06:22 +02:00
Julius Volz
6f33ed9e59 Add resets() function to count counter resets.
resets() returns for every range vector element how many counter
resets there have been in the specified range.
2015-05-26 17:56:52 +02:00
Fabian Reinartz
b7eb105ffa Remove test flags in help output 2015-05-23 12:23:33 +02:00
beorn7
3b9c421a69 Weed out all the [Gg]et* method names.
The only exception is getNumChunksToPersist to avoid naming the struct
member numChunksToPersist in a weird way.
2015-05-20 19:13:06 +02:00
Fabian Reinartz
ac4d63b833 Merge pull request #689 from prometheus/fabxc/qltest
Add basic testing language, migrate tests
2015-05-18 19:22:48 +02:00
Fabian Reinartz
0d3012a605 Migrate matrix tests, remove old test files. 2015-05-18 17:50:12 +02:00
Fabian Reinartz
71ef7ab405 Migrate remaining vector evaluation tests to new testing language. 2015-05-18 17:47:47 +02:00
Fabian Reinartz
3c22eded97 Migrate literal tests to testing language. 2015-05-18 17:47:47 +02:00
Fabian Reinartz
eba07a7d3d Migrate histogram tests to test language. 2015-05-18 17:47:47 +02:00
Fabian Reinartz
03094eff04 Migrate parsing error tests.
The promql_test checks failure of various bad syntaxed queries.
Those are moved into the parser tests as the new testing language
only deals with valid queries.
2015-05-18 17:47:47 +02:00
Fabian Reinartz
6321964738 Add parsing and execution of new test format.
This commit adds a new test structure that parses and executes
the new testing language.
2015-05-18 17:47:47 +02:00