Skip to content

Commit

Permalink
fix(prometheus): set wal_write_time and wal_sync_time as float64 (clo…
Browse files Browse the repository at this point in the history
…udnative-pg#2569)

Closes cloudnative-pg#2546

Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
  • Loading branch information
gbartolini authored Aug 11, 2023
1 parent f816759 commit d73d508
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/src/monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ metadata:
spec:
containers:
- name: curl
image: curlimages/curl:7.84.0
image: curlimages/curl:8.2.1
command: ['sleep', '3600']
```

Expand Down
4 changes: 2 additions & 2 deletions pkg/management/postgres/probes.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,8 @@ type PgStatWal struct {
WALBuffersFull int64
WalWrite int64
WalSync int64
WalWriteTime int64
WalSyncTime int64
WalWriteTime float64
WalSyncTime float64
StatsReset string
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/management/postgres/webserver/metricserver/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ func collectPGWALStat(e *Exporter) error {
}
walMetrics := e.Metrics.PgStatWalMetrics
walMetrics.WalSync.WithLabelValues(walStat.StatsReset).Set(float64(walStat.WalSync))
walMetrics.WalSyncTime.WithLabelValues(walStat.StatsReset).Set(float64(walStat.WalSyncTime))
walMetrics.WalSyncTime.WithLabelValues(walStat.StatsReset).Set(walStat.WalSyncTime)
walMetrics.WALBuffersFull.WithLabelValues(walStat.StatsReset).Set(float64(walStat.WALBuffersFull))
walMetrics.WalFpi.WithLabelValues(walStat.StatsReset).Set(float64(walStat.WalFpi))
walMetrics.WalWrite.WithLabelValues(walStat.StatsReset).Set(float64(walStat.WalWrite))
walMetrics.WalBytes.WithLabelValues(walStat.StatsReset).Set(float64(walStat.WalBytes))
walMetrics.WalWriteTime.WithLabelValues(walStat.StatsReset).Set(float64(walStat.WalWriteTime))
walMetrics.WalWriteTime.WithLabelValues(walStat.StatsReset).Set(walStat.WalWriteTime)
walMetrics.WalRecords.WithLabelValues(walStat.StatsReset).Set(float64(walStat.WalRecords))

return nil
Expand Down

0 comments on commit d73d508

Please sign in to comment.