Bug 2072805 - Observe > Dashboards: $__range variables cause PromQL query errors
Summary: Observe > Dashboards: $__range variables cause PromQL query errors
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Monitoring
Version: 4.11
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.11.0
Assignee: Andrew Pickering
QA Contact: Junqi Zhao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-04-07 02:12 UTC by Andrew Pickering
Modified: 2022-08-10 11:04 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-10 11:04:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 11289 0 None open Bug 2072805: Monitoring dashboards: Add support for __range* variables 2022-04-07 02:13:48 UTC

Description Andrew Pickering 2022-04-07 02:12:42 UTC
The Observe > Dashboards page doesn't handle the `$__range`, `$__range_s` or `$__range_ms` variables. This causes the Thanos API to return an error if any dashboard panel uses one of these variables.

Comment 3 Junqi Zhao 2022-04-18 06:53:26 UTC
tested with 4.11.0-0.nightly-2022-04-16-163450 and used the attached dashboard file, create configmap under openshift-config-managed, dashboard name: testing
definition:
*******************
                "repeat": null,
                "repeatIteration": null,
                "repeatRowId": null,
                "showTitle": true,
                "title": "HTTP Request Total",
                "titleSize": "h6",
                "type": "row"
            },
            {
                "aliasColors": {

                },
                "bars": true,
                "dashLength": 10,
                "dashes": false,
                "datasource": "$datasource",
                "fill": 2,
                "fillGradient": 0,
                "gridPos": {
                    "h": 9,
                    "w": 12,
                    "x": 0,
                    "y": 1
                },
                "id": 3,
                "legend": {
                    "alignAsTable": true,
                    "avg": false,
                    "current": true,
                    "hideEmpty": true,
                    "hideZero": true,
                    "max": false,
                    "min": false,
                    "rightSide": true,
                    "show": true,
                    "sideWidth": null,
                    "sort": "current",
                    "sortDesc": true,
                    "total": false,
                    "values": true
                },
                "lines": false,
                "linewidth": 1,
                "links": [

                ],
                "minSpan": 24,
                "nullPointMode": "null",
                "paceLength": 10,
                "percentage": false,
                "pointradius": 5,
                "points": false,
                "renderer": "flot",
                "repeat": null,
                "seriesOverrides": [

                ],
                "spaceLength": 10,
                "span": 24,
                "stack": false,
                "steppedLine": false,
                "targets": [
                    {
                        "expr": "(topk(5, sum(rate(http_requests_total[$__range])) by (instance)))",
                        "format": "time_series",
                        "legendFormat": "{{instance}}",
                        "refId": "A"
                    }
                ],
*******************
go to "Observe -> Dashboards", choose dashboard testing, select any value from "Time Range" drop-down list, for example "Last 15 minutes", "HTTP Request Total" section, click Inspect, prometheus expr is: (topk(5, sum(rate(http_requests_total[900s])) by (instance)))
$__range is parsed right, 15*60=900s

Comment 7 errata-xmlrpc 2022-08-10 11:04:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5069


Note You need to log in before you can comment on or make changes to this bug.