Skip to content
This repository was archived by the owner on Jul 11, 2022. It is now read-only.

Commit adc98cc

Browse files
authored
Merge pull request #147 from prometheus-community/feature/present_over_time
support present_over_time + cut 0.17.0
2 parents 7f70559 + 5d46414 commit adc98cc

File tree

6 files changed

+30
-11
lines changed

6 files changed

+30
-11
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
0.17.0 / 2021-08-10
2+
===================
3+
4+
* **[Feature]**: Support `present_over_time`
5+
* **[Feature]**: HTTP method used to contact Prometheus is now configurable.
6+
17
0.16.0 / 2021-05-20
28
===================
39

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codemirror-promql",
3-
"version": "0.16.0",
3+
"version": "0.17.0",
44
"description": "a CodeMirror mode for the PromQL language",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",
@@ -31,7 +31,7 @@
3131
},
3232
"homepage": "https://github.com/prometheus-community/codemirror-promql/blob/master/README.md",
3333
"dependencies": {
34-
"lezer-promql": "^0.19.0",
34+
"lezer-promql": "^0.20.0",
3535
"lru-cache": "^6.0.0"
3636
},
3737
"devDependencies": {

src/lang-promql/complete/promql.terms.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@ export const functionIdentifierTerms = [
259259
info: 'Predict the value of a gauge into the future',
260260
type: 'function',
261261
},
262+
{
263+
label: 'present_over_time',
264+
detail: 'function',
265+
info: 'the value 1 for any series in the specified interval',
266+
type: 'function',
267+
},
262268
{
263269
label: 'quantile_over_time',
264270
detail: 'function',

src/lang-promql/promql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function promQLLanguage(top: LanguageType) {
4444
StringLiteral: tags.string,
4545
NumberLiteral: tags.number,
4646
Duration: tags.number,
47-
'Abs Absent AbsentOverTime AvgOverTime Ceil Changes Clamp ClampMax ClampMin CountOverTime DaysInMonth DayOfMonth DayOfWeek Delta Deriv Exp Floor HistogramQuantile HoltWinters Hour Idelta Increase Irate LabelReplace LabelJoin LastOverTime Ln Log10 Log2 MaxOverTime MinOverTime Minute Month PredictLinear QuantileOverTime Rate Resets Round Scalar Sgn Sort SortDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Time Timestamp Vector Year': tags.function(
47+
'Abs Absent AbsentOverTime AvgOverTime Ceil Changes Clamp ClampMax ClampMin CountOverTime DaysInMonth DayOfMonth DayOfWeek Delta Deriv Exp Floor HistogramQuantile HoltWinters Hour Idelta Increase Irate LabelReplace LabelJoin LastOverTime Ln Log10 Log2 MaxOverTime MinOverTime Minute Month PredictLinear PresentOverTime QuantileOverTime Rate Resets Round Scalar Sgn Sort SortDesc Sqrt StddevOverTime StdvarOverTime SumOverTime Time Timestamp Vector Year': tags.function(
4848
tags.variableName
4949
),
5050
'Avg Bottomk Count Count_values Group Max Min Quantile Stddev Stdvar Sum Topk': tags.operatorKeyword,

src/lang-promql/types/function.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import {
5555
Minute,
5656
Month,
5757
PredictLinear,
58+
PresentOverTime,
5859
QuantileOverTime,
5960
Rate,
6061
Resets,
@@ -295,6 +296,12 @@ const promqlFunctions: { [key: number]: PromQLFunction } = {
295296
variadic: 0,
296297
returnType: ValueType.vector,
297298
},
299+
[PresentOverTime]: {
300+
name: 'present_over_time',
301+
argTypes: [ValueType.matrix],
302+
variadic: 0,
303+
returnType: ValueType.vector,
304+
},
298305
[QuantileOverTime]: {
299306
name: 'quantile_over_time',
300307
argTypes: [ValueType.scalar, ValueType.matrix],

0 commit comments

Comments
 (0)