Skip to content

Commit fd664b3

Browse files
authored
docs: Correct PromQL tile expression, table, and reducer descriptions
Only line and stacked tiles query every expression; other display types query the first. Tables have one row per sample, and reducers also apply to instant queries.
1 parent 4182b4e commit fd664b3

2 files changed

Lines changed: 30 additions & 17 deletions

File tree

‎packages/api/openapi.json‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2910,7 +2910,7 @@
29102910
"sum",
29112911
"count"
29122912
],
2913-
"description": "How a range query's samples are reduced to one value. Only used when queryType is \"range\". Defaults to \"lastNotNull\" when omitted.\n",
2913+
"description": "How each series' samples are reduced to one value. Defaults to \"lastNotNull\" when omitted. It also applies to instant queries, where each series has a single sample, so e.g. \"count\" turns every value into 1.\n",
29142914
"example": "max"
29152915
}
29162916
}
@@ -3095,7 +3095,7 @@
30953095
]
30963096
},
30973097
"TablePromqlChartConfig": {
3098-
"description": "PromQL configuration for a table chart, with one row per series and one column per label.\n",
3098+
"description": "PromQL configuration for a table chart, with one row per sample: a column per label, a Value column, and a Timestamp column when the expression is a range query. An instant query gives one row per series.\n",
30993099
"allOf": [
31003100
{
31013101
"$ref": "#/components/schemas/PromqlChartConfigBase"
@@ -3119,7 +3119,7 @@
31193119
"type": "array",
31203120
"minItems": 1,
31213121
"maxItems": 10,
3122-
"description": "PromQL expressions to tabulate.",
3122+
"description": "PromQL expressions. Only the first is queried; the rest are kept but ignored.\n",
31233123
"items": {
31243124
"$ref": "#/components/schemas/PromqlInstantExpression"
31253125
}
@@ -3153,7 +3153,7 @@
31533153
"type": "array",
31543154
"minItems": 1,
31553155
"maxItems": 10,
3156-
"description": "PromQL expressions. The tile displays the first value.",
3156+
"description": "PromQL expressions. Only the first is queried; the rest are kept but ignored. The tile displays the first value.\n",
31573157
"items": {
31583158
"$ref": "#/components/schemas/PromqlReducibleExpression"
31593159
}
@@ -3203,7 +3203,7 @@
32033203
"type": "array",
32043204
"minItems": 1,
32053205
"maxItems": 10,
3206-
"description": "PromQL expressions to plot.",
3206+
"description": "PromQL expressions. Only the first is queried; the rest are kept but ignored.\n",
32073207
"items": {
32083208
"$ref": "#/components/schemas/PromqlReducibleExpression"
32093209
}
@@ -3249,7 +3249,7 @@
32493249
"type": "array",
32503250
"minItems": 1,
32513251
"maxItems": 10,
3252-
"description": "PromQL expressions to plot.",
3252+
"description": "PromQL expressions. Only the first is queried; the rest are kept but ignored.\n",
32533253
"items": {
32543254
"$ref": "#/components/schemas/PromqlReducibleExpression"
32553255
}
@@ -3295,7 +3295,7 @@
32953295
"type": "array",
32963296
"minItems": 1,
32973297
"maxItems": 10,
3298-
"description": "PromQL expressions to plot.",
3298+
"description": "PromQL expressions. Only the first is queried; the rest are kept but ignored.\n",
32993299
"items": {
33003300
"$ref": "#/components/schemas/PromqlRangeExpression"
33013301
}

‎packages/api/src/routers/external-api/v2/dashboards.ts‎

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,9 +1563,10 @@ const EXTERNAL_DASHBOARD_PROJECTION = {
15631563
* type: string
15641564
* enum: [lastNotNull, min, max, mean, sum, count]
15651565
* description: >
1566-
* How a range query's samples are reduced to one value. Only
1567-
* used when queryType is "range". Defaults to "lastNotNull"
1568-
* when omitted.
1566+
* How each series' samples are reduced to one value. Defaults
1567+
* to "lastNotNull" when omitted. It also applies to instant
1568+
* queries, where each series has a single sample, so e.g.
1569+
* "count" turns every value into 1.
15691570
* example: "max"
15701571
*
15711572
* PromqlChartConfigBase:
@@ -1697,8 +1698,10 @@ const EXTERNAL_DASHBOARD_PROJECTION = {
16971698
*
16981699
* TablePromqlChartConfig:
16991700
* description: >
1700-
* PromQL configuration for a table chart, with one row per series and
1701-
* one column per label.
1701+
* PromQL configuration for a table chart, with one row per sample: a
1702+
* column per label, a Value column, and a Timestamp column when the
1703+
* expression is a range query. An instant query gives one row per
1704+
* series.
17021705
* allOf:
17031706
* - $ref: '#/components/schemas/PromqlChartConfigBase'
17041707
* - type: object
@@ -1715,7 +1718,9 @@ const EXTERNAL_DASHBOARD_PROJECTION = {
17151718
* type: array
17161719
* minItems: 1
17171720
* maxItems: 10
1718-
* description: PromQL expressions to tabulate.
1721+
* description: >
1722+
* PromQL expressions. Only the first is queried; the rest are
1723+
* kept but ignored.
17191724
* items:
17201725
* $ref: '#/components/schemas/PromqlInstantExpression'
17211726
*
@@ -1737,7 +1742,9 @@ const EXTERNAL_DASHBOARD_PROJECTION = {
17371742
* type: array
17381743
* minItems: 1
17391744
* maxItems: 10
1740-
* description: PromQL expressions. The tile displays the first value.
1745+
* description: >
1746+
* PromQL expressions. Only the first is queried; the rest are
1747+
* kept but ignored. The tile displays the first value.
17411748
* items:
17421749
* $ref: '#/components/schemas/PromqlReducibleExpression'
17431750
* color:
@@ -1776,7 +1783,9 @@ const EXTERNAL_DASHBOARD_PROJECTION = {
17761783
* type: array
17771784
* minItems: 1
17781785
* maxItems: 10
1779-
* description: PromQL expressions to plot.
1786+
* description: >
1787+
* PromQL expressions. Only the first is queried; the rest are
1788+
* kept but ignored.
17801789
* items:
17811790
* $ref: '#/components/schemas/PromqlReducibleExpression'
17821791
* legendTemplate:
@@ -1813,7 +1822,9 @@ const EXTERNAL_DASHBOARD_PROJECTION = {
18131822
* type: array
18141823
* minItems: 1
18151824
* maxItems: 10
1816-
* description: PromQL expressions to plot.
1825+
* description: >
1826+
* PromQL expressions. Only the first is queried; the rest are
1827+
* kept but ignored.
18171828
* items:
18181829
* $ref: '#/components/schemas/PromqlReducibleExpression'
18191830
* legendTemplate:
@@ -1850,7 +1861,9 @@ const EXTERNAL_DASHBOARD_PROJECTION = {
18501861
* type: array
18511862
* minItems: 1
18521863
* maxItems: 10
1853-
* description: PromQL expressions to plot.
1864+
* description: >
1865+
* PromQL expressions. Only the first is queried; the rest are
1866+
* kept but ignored.
18541867
* items:
18551868
* $ref: '#/components/schemas/PromqlRangeExpression'
18561869
* heatmapMode:

0 commit comments

Comments
 (0)