Brian Brazil
29e8dc2c49
promql: Add 'bool' modifier to comparison functions
...
When doing comparison operations on vectors, filtering
sometimes gets in the way and you have to go to a fair bit of
effort to workaround it in order to always return a result.
The 'bool' modifier instead of filtering returns 0/1 depending
on the result of the compairson.
This is also a prerequisite to removing plain scalar/scalar comparisons,
as it maintains the current behaviour under a new syntax.
2015-09-02 14:51:44 +01:00
Julius Volz
077a753e6b
Merge pull request #1006 from prometheus/true-values
...
promql: Remove interpolation of vector values.
2015-08-25 16:11:07 +02:00
Fabian Reinartz
d6b8da8d43
Switch promql types to common/model
2015-08-25 13:49:14 +02:00
Brian Brazil
fb585e4591
promql: Remove interpolation of vector values.
...
The current behaviour produces values that are not
from rules or scrapes. So if for example I have
a boolean 0/1 it can be returned as 0.2344589. This
prevents a number of advanced use cases, introduces
race conditions and can produce misleading graphs.
2015-08-24 17:37:31 +01:00
Fabian Reinartz
1535ef1457
Replace metric.SamplePair with model.SamplePair
2015-08-22 14:52:35 +02:00
Fabian Reinartz
438e232c9b
Fix grouping of import blocks
2015-08-22 09:42:45 +02:00
Fabian Reinartz
306e8468a0
Switch from client_golang/model to common/model
2015-08-21 13:33:38 +02:00
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