@@ -137,4 +137,130 @@ local prometheus = grafana.prometheus;
137137 ).where('metric_name' , '=' , 'tnt_clock_delta' ).where('label_pairs_alias' , '=~' , alias)
138138 .selectField('value' ).addConverter('last' )
139139 ),
140+
141+ local syncro_warning(description) = std.join (
142+ '\n ' ,
143+ [description, |||
144+ Panel works with metrics 0.15.0 or newer, Tarantool 2.8.1 or newer.
145+ ||| ]
146+ ),
147+
148+ synchro_queue_owner(
149+ title='Synchronous queue owner' ,
150+ description=syncro_warning(|||
151+ Instance ID of the current synchronous replication master.
152+ ||| ),
153+ datasource_type=null ,
154+ datasource=null ,
155+ policy=null ,
156+ measurement=null ,
157+ job=null ,
158+ alias=null ,
159+ ):: common.default_graph(
160+ title=title,
161+ description=description,
162+ datasource=datasource,
163+ labelY1='owner id' ,
164+ decimals=0 ,
165+ panel_width=6 ,
166+ legend_avg=false ,
167+ legend_max=false ,
168+ ).addTarget(common.default_metric_target(
169+ datasource_type,
170+ 'tnt_synchro_queue_owner' ,
171+ job,
172+ policy,
173+ measurement,
174+ alias,
175+ )),
176+
177+ synchro_queue_term(
178+ title='Synchronous queue term' ,
179+ description=syncro_warning(|||
180+ Current queue term.
181+ ||| ),
182+ datasource_type=null ,
183+ datasource=null ,
184+ policy=null ,
185+ measurement=null ,
186+ job=null ,
187+ alias=null ,
188+ ):: common.default_graph(
189+ title=title,
190+ description=description,
191+ datasource=datasource,
192+ labelY1='term' ,
193+ decimals=0 ,
194+ panel_width=6 ,
195+ legend_avg=false ,
196+ legend_max=false ,
197+ ).addTarget(common.default_metric_target(
198+ datasource_type,
199+ 'tnt_synchro_queue_term' ,
200+ job,
201+ policy,
202+ measurement,
203+ alias,
204+ )),
205+
206+ synchro_queue_length(
207+ title='Synchronous queue transactions' ,
208+ description=syncro_warning(|||
209+ Count of transactions collecting confirmations now.
210+ ||| ),
211+ datasource_type=null ,
212+ datasource=null ,
213+ policy=null ,
214+ measurement=null ,
215+ job=null ,
216+ alias=null ,
217+ ):: common.default_graph(
218+ title=title,
219+ description=description,
220+ datasource=datasource,
221+ labelY1='current' ,
222+ panel_width=6 ,
223+ ).addTarget(common.default_metric_target(
224+ datasource_type,
225+ 'tnt_synchro_queue_len' ,
226+ job,
227+ policy,
228+ measurement,
229+ alias,
230+ )),
231+
232+ synchro_queue_busy(
233+ title='Synchronous queue busy' ,
234+ description=syncro_warning(|||
235+ Whether the queue is processing any system entry (CONFIRM/ROLLBACK/PROMOTE/DEMOTE).
236+
237+ Panel works with Grafana 8.x.
238+ ||| ),
239+ datasource_type=null ,
240+ datasource=null ,
241+ policy=null ,
242+ measurement=null ,
243+ job=null ,
244+ alias=null ,
245+ ):: timeseries.new(
246+ title=title,
247+ description=description,
248+ datasource=datasource,
249+ panel_width=6 ,
250+ max=1 ,
251+ min=0 ,
252+ ).addValueMapping(
253+ 1 , 'yellow' , 'busy'
254+ ).addValueMapping(
255+ 0 , 'green' , 'not busy'
256+ ).addRangeMapping(
257+ 0.001 , 0.999 , '-'
258+ ).addTarget(common.default_metric_target(
259+ datasource_type,
260+ 'tnt_synchro_queue_busy' ,
261+ job,
262+ policy,
263+ measurement,
264+ alias,
265+ )),
140266}
0 commit comments