|
18 | 18 | "editable": true, |
19 | 19 | "fiscalYearStartMonth": 0, |
20 | 20 | "graphTooltip": 0, |
| 21 | + "id": 3, |
21 | 22 | "links": [], |
22 | 23 | "panels": [ |
23 | 24 | { |
|
100 | 101 | "editorMode": "code", |
101 | 102 | "editorType": "sql", |
102 | 103 | "format": 1, |
| 104 | + "meta": {}, |
| 105 | + "pluginVersion": "4.11.2", |
| 106 | + "queryType": "table", |
103 | 107 | "range": true, |
104 | | - "rawSql": "WITH\n $__timeInterval(TimeUnix) as time_bucket,\n arrayJoin(arrayEnumerate(BucketCounts)) AS idx,\n ExplicitBounds AS bounds\nSELECT\n time_bucket as Time,\n bounds[idx+1] AS le,\n sum(BucketCounts[idx]) AS count\nFROM otel.otel_metrics_histogram\nWHERE\n MetricName = 'rivet_instrumented_future_duration'\n AND $__conditionalAll(Attributes['name'], $name)\n AND $__conditionalAll(Attributes['location'], $location)\n AND $__timeFilter(TimeUnix)\nGROUP BY Time, le\nORDER BY Time, le", |
| 108 | + "rawSql": "WITH\n 30 as collector_rate_s\n\nSELECT Time, bucket, count\nFROM (\n SELECT\n Time,\n bucket,\n greatest(0, count - lagInFrame(count, 1, 0) OVER (PARTITION BY bucket ORDER BY Time)) AS count\n FROM (\n WITH\n $__timeInterval(TimeUnix) as time_bucket,\n arrayJoin(arrayEnumerate(BucketCounts)) AS idx,\n case when idx = length(BucketCounts) then inf else ExplicitBounds[idx] end as bucket\n SELECT\n time_bucket as Time,\n bucket,\n sum(BucketCounts[idx]) AS count\n FROM otel.otel_metrics_histogram\n WHERE\n MetricName = 'rivet_instrumented_future_duration'\n -- AND ResourceAttributes['rivet.project'] IN array($project)\n -- AND ResourceAttributes['rivet.datacenter'] IN array($datacenter)\n AND Attributes['name'] IN array($name)\n AND Attributes['location'] IN array($location)\n AND TimeUnix >= $__fromTime_ms() - toIntervalMillisecond(greatest(collector_rate_s * 1000, $__interval_s * 1000))\n AND TimeUnix <= $__toTime_ms()\n AND AggregationTemporality = 2\n GROUP BY Time, bucket\n )\n)\nWHERE $__timeFilter(Time)", |
105 | 109 | "refId": "A" |
106 | 110 | } |
107 | 111 | ], |
|
110 | 114 | { |
111 | 115 | "id": "groupingToMatrix", |
112 | 116 | "options": { |
113 | | - "columnField": "le", |
| 117 | + "columnField": "bucket", |
114 | 118 | "emptyValue": "zero", |
115 | 119 | "rowField": "Time", |
116 | 120 | "valueField": "count" |
|
122 | 126 | "conversions": [ |
123 | 127 | { |
124 | 128 | "destinationType": "time", |
125 | | - "targetField": "Time\\le" |
| 129 | + "targetField": "Time\\bucket" |
126 | 130 | } |
127 | 131 | ], |
128 | 132 | "fields": {} |
|
138 | 142 | "tags": [], |
139 | 143 | "templating": { |
140 | 144 | "list": [ |
| 145 | + { |
| 146 | + "current": { |
| 147 | + "text": ["All"], |
| 148 | + "value": ["$__all"] |
| 149 | + }, |
| 150 | + "definition": "SELECT DISTINCT ResourceAttributes['rivet.project'] FROM otel.otel_metrics_gauge WHERE ServiceName = 'rivet' ORDER BY ResourceAttributes['rivet.project']", |
| 151 | + "description": "", |
| 152 | + "includeAll": true, |
| 153 | + "label": "project", |
| 154 | + "multi": true, |
| 155 | + "name": "project", |
| 156 | + "options": [], |
| 157 | + "query": "SELECT DISTINCT ResourceAttributes['rivet.project'] FROM otel.otel_metrics_gauge WHERE ServiceName = 'rivet' ORDER BY ResourceAttributes['rivet.project']", |
| 158 | + "refresh": 1, |
| 159 | + "regex": "", |
| 160 | + "type": "query" |
| 161 | + }, |
| 162 | + { |
| 163 | + "current": { |
| 164 | + "text": "All", |
| 165 | + "value": "$__all" |
| 166 | + }, |
| 167 | + "definition": "SELECT DISTINCT ResourceAttributes['rivet.datacenter'] FROM otel.otel_metrics_gauge WHERE ServiceName = 'rivet' AND ResourceAttributes['rivet.project'] IN array($project) ORDER BY ResourceAttributes['rivet.datacenter']", |
| 168 | + "includeAll": true, |
| 169 | + "label": "datacenter", |
| 170 | + "multi": true, |
| 171 | + "name": "datacenter", |
| 172 | + "options": [], |
| 173 | + "query": "SELECT DISTINCT ResourceAttributes['rivet.datacenter'] FROM otel.otel_metrics_gauge WHERE ServiceName = 'rivet' AND ResourceAttributes['rivet.project'] IN array($project) ORDER BY ResourceAttributes['rivet.datacenter']", |
| 174 | + "refresh": 1, |
| 175 | + "regex": "", |
| 176 | + "type": "query" |
| 177 | + }, |
141 | 178 | { |
142 | 179 | "current": { |
143 | 180 | "text": ["All"], |
|
147 | 184 | "type": "grafana-clickhouse-datasource", |
148 | 185 | "uid": "clickhouse" |
149 | 186 | }, |
150 | | - "definition": "SELECT DISTINCT Attributes['name'] as name FROM otel.otel_metrics_histogram WHERE MetricName = 'rivet_instrumented_future_duration' ORDER BY name", |
| 187 | + "definition": "SELECT DISTINCT Attributes['name'] FROM otel.otel_metrics_histogram WHERE ServiceName = 'rivet' AND MetricName = 'rivet_instrumented_future_duration' AND ResourceAttributes['rivet.project'] IN array($project) ORDER BY Attributes['name']", |
151 | 188 | "includeAll": true, |
152 | | - "label": "Name", |
| 189 | + "label": "name", |
153 | 190 | "multi": true, |
154 | 191 | "name": "name", |
155 | 192 | "options": [], |
156 | | - "query": { |
157 | | - "qryType": 1, |
158 | | - "rawSql": "SELECT DISTINCT Attributes['name'] as name FROM otel.otel_metrics_histogram WHERE MetricName = 'rivet_instrumented_future_duration' ORDER BY name", |
159 | | - "refId": "ClickHouseVariableQueryEditor-VariableQuery" |
160 | | - }, |
| 193 | + "query": "SELECT DISTINCT Attributes['name'] FROM otel.otel_metrics_histogram WHERE ServiceName = 'rivet' AND MetricName = 'rivet_instrumented_future_duration' AND ResourceAttributes['rivet.project'] IN array($project) ORDER BY Attributes['name']", |
161 | 194 | "refresh": 1, |
162 | 195 | "regex": "", |
163 | 196 | "type": "query" |
|
171 | 204 | "type": "grafana-clickhouse-datasource", |
172 | 205 | "uid": "clickhouse" |
173 | 206 | }, |
174 | | - "definition": "SELECT DISTINCT Attributes['location'] as location FROM otel.otel_metrics_histogram WHERE MetricName = 'rivet_instrumented_future_duration' ORDER BY location", |
| 207 | + "definition": "SELECT DISTINCT Attributes['location'] FROM otel.otel_metrics_histogram WHERE ServiceName = 'rivet' AND MetricName = 'rivet_instrumented_future_duration' AND ResourceAttributes['rivet.project'] IN array($project) ORDER BY Attributes['location']", |
175 | 208 | "includeAll": true, |
176 | | - "label": "Location", |
| 209 | + "label": "location", |
177 | 210 | "multi": true, |
178 | 211 | "name": "location", |
179 | 212 | "options": [], |
180 | | - "query": { |
181 | | - "qryType": 1, |
182 | | - "rawSql": "SELECT DISTINCT Attributes['location'] as location FROM otel.otel_metrics_histogram WHERE MetricName = 'rivet_instrumented_future_duration' ORDER BY location", |
183 | | - "refId": "ClickHouseVariableQueryEditor-VariableQuery" |
184 | | - }, |
| 213 | + "query": "SELECT DISTINCT Attributes['location'] FROM otel.otel_metrics_histogram WHERE ServiceName = 'rivet' AND MetricName = 'rivet_instrumented_future_duration' AND ResourceAttributes['rivet.project'] IN array($project) ORDER BY Attributes['location']", |
185 | 214 | "refresh": 1, |
186 | 215 | "regex": "", |
187 | 216 | "type": "query" |
188 | | - }, |
189 | | - { |
190 | | - "current": { |
191 | | - "text": "30", |
192 | | - "value": "30" |
193 | | - }, |
194 | | - "hide": 2, |
195 | | - "label": "Metric Export Interval (seconds)", |
196 | | - "name": "metric_interval", |
197 | | - "query": "30", |
198 | | - "skipUrlSync": true, |
199 | | - "type": "constant" |
200 | 217 | } |
201 | 218 | ] |
202 | 219 | }, |
|
207 | 224 | "timepicker": {}, |
208 | 225 | "timezone": "browser", |
209 | 226 | "title": "Futures", |
210 | | - "version": 0, |
| 227 | + "uid": "ef353ektqu4g0e", |
| 228 | + "version": 1, |
211 | 229 | "weekStart": "" |
212 | 230 | } |
0 commit comments