You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: Add dashboard scope management
* docs: Add scoping information for dashboards
* style: Format files
* fix: Do not read response body on failed request
*`description` - (Optional) Description of the dashboard.
78
90
79
91
*`public` - (Optional) Define if the dashboard can be accessible without requiring the user to be logged in.
92
+
93
+
*`scope` - (Optional) Define the scope of the dashboard and variables for these metrics.
80
94
81
95
*`panel` - (Required) At least 1 panel is required to define a Dashboard.
82
96
97
+
98
+
### scope
99
+
100
+
Dashboard scope defines what data is valid for aggregation and display within the dashboard.
101
+
See more info about how to [use the scope in a PromQL query](https://docs.sysdig.com/en/using-promql.html#UUID-2314cf2d-3466-d7a5-142a-30a9e63053d0_UUID-8dfed5eb-8c48-8f94-4e3a-61b051fb9b440) in the official documentation.
102
+
103
+
The following arguments are supported to configure a scope:
104
+
105
+
*`metric` - (Required) Metric to scope by, common examples are `host.hostName`, `kubernetes.namespace.name` or `kubernetes.cluster.name`, but you can use all the Sysdig-supported values shown in the UI. Note that kubernetes-related values only appear when Sysdig detects Kubernetes metadata.
106
+
107
+
*`comparator` - (Optional) Operator to relate the metric with some value. It is only required if the value to filter by is set, or the variable field is not set. Valid values are: `in`, `notIn`, `equals`, `notEquals`, `contains`, `notContains` and `startsWith`.
108
+
109
+
*`value` - (Optional) List of values to filter by, if comparator is set. If the comparator is not `in` or `notIn` the list must contain only 1 value.
110
+
111
+
*`variable` - (Optional) Assigns this metric to a value name and allows PromQL to reference it.
112
+
113
+
83
114
### panel
84
115
85
116
The whole screen for a dashboard is separated in 24 squares of width. All the panels must not
@@ -123,6 +154,13 @@ The following arguments are supported:
123
154
124
155
### query
125
156
157
+
To scope a panel built from a PromQL query, you must use a scope variable within the query. The variable will take the value of the referenced scope parameter, and the PromQL panel will change accordingly.
158
+
There are two predefined variables available:
159
+
160
+
-`$__interval` represents the time interval defined based on the time range. This will help to adapt the time range for different operations, such as rate and avg_over_time, and prevent displaying empty graphs due to the change in the granularity of the data.
161
+
162
+
-`$__range` represents the time interval defined for the dashboard. This is used to adapt operations like calculating average for a time frame selected.
163
+
126
164
The following arguments are supported:
127
165
128
166
*`promql` - (Required) The PromQL query. Must be a valid PromQL query with existing
0 commit comments