@@ -205,55 +205,48 @@ func (c *PGStatWalReceiverCollector) Update(ctx context.Context, instance *insta
205
205
level .Debug (c .log ).Log ("msg" , "Skipping wal receiver stats because upstream_node is null" )
206
206
continue
207
207
}
208
- receiveStartLsnMetric := float64 (receiveStartLsn .Int64 )
209
208
ch <- prometheus .MustNewConstMetric (
210
209
statWalReceiverReceiveStartLsn ,
211
210
prometheus .CounterValue ,
212
- receiveStartLsnMetric ,
211
+ float64 ( receiveStartLsn . Int64 ) ,
213
212
labels ... )
214
213
215
- receiveStartTliMetric := float64 (receiveStartTli .Int64 )
216
214
ch <- prometheus .MustNewConstMetric (
217
215
statWalReceiverReceiveStartTli ,
218
216
prometheus .GaugeValue ,
219
- receiveStartTliMetric ,
217
+ float64 ( receiveStartTli . Int64 ) ,
220
218
labels ... )
221
219
222
220
if hasFlushedLSN {
223
- flushedLsnMetric := float64 (flushedLsn .Int64 )
224
221
ch <- prometheus .MustNewConstMetric (
225
222
statWalReceiverFlushedLSN ,
226
223
prometheus .CounterValue ,
227
- flushedLsnMetric ,
224
+ float64 ( flushedLsn . Int64 ) ,
228
225
labels ... )
229
226
}
230
227
231
- receivedTliMetric := float64 (receivedTli .Int64 )
232
228
ch <- prometheus .MustNewConstMetric (
233
229
statWalReceiverReceivedTli ,
234
230
prometheus .GaugeValue ,
235
- receivedTliMetric ,
231
+ float64 ( receivedTli . Int64 ) ,
236
232
labels ... )
237
233
238
- lastMsgSendTimeMetric := float64 (lastMsgSendTime .Float64 )
239
234
ch <- prometheus .MustNewConstMetric (
240
235
statWalReceiverLastMsgSendTime ,
241
236
prometheus .CounterValue ,
242
- lastMsgSendTimeMetric ,
237
+ float64 ( lastMsgSendTime . Float64 ) ,
243
238
labels ... )
244
239
245
- lastMsgReceiptTimeMetric := float64 (lastMsgReceiptTime .Float64 )
246
240
ch <- prometheus .MustNewConstMetric (
247
241
statWalReceiverLastMsgReceiptTime ,
248
242
prometheus .CounterValue ,
249
- lastMsgReceiptTimeMetric ,
243
+ float64 ( lastMsgReceiptTime . Float64 ) ,
250
244
labels ... )
251
245
252
- latestEndLsnMetric := float64 (latestEndLsn .Int64 )
253
246
ch <- prometheus .MustNewConstMetric (
254
247
statWalReceiverLatestEndLsn ,
255
248
prometheus .CounterValue ,
256
- latestEndLsnMetric ,
249
+ float64 ( latestEndLsn . Int64 ) ,
257
250
labels ... )
258
251
259
252
ch <- prometheus .MustNewConstMetric (
@@ -262,11 +255,10 @@ func (c *PGStatWalReceiverCollector) Update(ctx context.Context, instance *insta
262
255
latestEndTime .Float64 ,
263
256
labels ... )
264
257
265
- upstreamNodeMetric := float64 (upstreamNode .Int64 )
266
258
ch <- prometheus .MustNewConstMetric (
267
259
statWalReceiverUpstreamNode ,
268
260
prometheus .GaugeValue ,
269
- upstreamNodeMetric ,
261
+ float64 ( upstreamNode . Int64 ) ,
270
262
labels ... )
271
263
}
272
264
if err := rows .Err (); err != nil {
0 commit comments