@@ -150,15 +150,15 @@ var (
150
150
[]string {"datname" , "schemaname" , "relname" },
151
151
prometheus.Labels {},
152
152
)
153
- statUserTablesTotalSize = prometheus .NewDesc (
154
- prometheus .BuildFQName (namespace , userTableSubsystem , "size_bytes " ),
155
- "Total disk space used by this table , in bytes, including all indexes and TOAST data " ,
153
+ statUserIndexSize = prometheus .NewDesc (
154
+ prometheus .BuildFQName (namespace , userTableSubsystem , "index_size_bytes " ),
155
+ "Total disk space used by this index , in bytes" ,
156
156
[]string {"datname" , "schemaname" , "relname" },
157
157
prometheus.Labels {},
158
158
)
159
- statUserTablesOnlySize = prometheus .NewDesc (
159
+ statUserTableSize = prometheus .NewDesc (
160
160
prometheus .BuildFQName (namespace , userTableSubsystem , "table_size_bytes" ),
161
- "Total disk space used by only this table, in bytes" ,
161
+ "Total disk space used by this table, in bytes" ,
162
162
[]string {"datname" , "schemaname" , "relname" },
163
163
prometheus.Labels {},
164
164
)
@@ -205,10 +205,10 @@ func (c *PGStatUserTablesCollector) Update(ctx context.Context, instance *instan
205
205
for rows .Next () {
206
206
var datname , schemaname , relname sql.NullString
207
207
var seqScan , seqTupRead , idxScan , idxTupFetch , nTupIns , nTupUpd , nTupDel , nTupHotUpd , nLiveTup , nDeadTup ,
208
- nModSinceAnalyze , vacuumCount , autovacuumCount , analyzeCount , autoanalyzeCount , totalSize , tableOnlySize sql.NullInt64
208
+ nModSinceAnalyze , vacuumCount , autovacuumCount , analyzeCount , autoanalyzeCount , indexSize , tableSize sql.NullInt64
209
209
var lastVacuum , lastAutovacuum , lastAnalyze , lastAutoanalyze sql.NullTime
210
210
211
- if err := rows .Scan (& datname , & schemaname , & relname , & seqScan , & seqTupRead , & idxScan , & idxTupFetch , & nTupIns , & nTupUpd , & nTupDel , & nTupHotUpd , & nLiveTup , & nDeadTup , & nModSinceAnalyze , & lastVacuum , & lastAutovacuum , & lastAnalyze , & lastAutoanalyze , & vacuumCount , & autovacuumCount , & analyzeCount , & autoanalyzeCount , & totalSize , & tableOnlySize ); err != nil {
211
+ if err := rows .Scan (& datname , & schemaname , & relname , & seqScan , & seqTupRead , & idxScan , & idxTupFetch , & nTupIns , & nTupUpd , & nTupDel , & nTupHotUpd , & nLiveTup , & nDeadTup , & nModSinceAnalyze , & lastVacuum , & lastAutovacuum , & lastAnalyze , & lastAutoanalyze , & vacuumCount , & autovacuumCount , & analyzeCount , & autoanalyzeCount , & indexSize , & tableSize ); err != nil {
212
212
return err
213
213
}
214
214
@@ -434,25 +434,25 @@ func (c *PGStatUserTablesCollector) Update(ctx context.Context, instance *instan
434
434
datnameLabel , schemanameLabel , relnameLabel ,
435
435
)
436
436
437
- totalSizeMetric := 0.0
438
- if totalSize .Valid {
439
- totalSizeMetric = float64 (totalSize .Int64 )
437
+ indexSizeMetric := 0.0
438
+ if indexSize .Valid {
439
+ indexSizeMetric = float64 (indexSize .Int64 )
440
440
}
441
441
ch <- prometheus .MustNewConstMetric (
442
- statUserTablesTotalSize ,
442
+ statUserIndexSize ,
443
443
prometheus .GaugeValue ,
444
- totalSizeMetric ,
444
+ indexSizeMetric ,
445
445
datnameLabel , schemanameLabel , relnameLabel ,
446
446
)
447
447
448
- tableOnlySizeMetric := 0.0
449
- if tableOnlySize .Valid {
450
- tableOnlySizeMetric = float64 (tableOnlySize .Int64 )
448
+ tableSizeMetric := 0.0
449
+ if tableSize .Valid {
450
+ tableSizeMetric = float64 (tableSize .Int64 )
451
451
}
452
452
ch <- prometheus .MustNewConstMetric (
453
- statUserTablesOnlySize ,
453
+ statUserTableSize ,
454
454
prometheus .GaugeValue ,
455
- tableOnlySizeMetric ,
455
+ tableSizeMetric ,
456
456
datnameLabel , schemanameLabel , relnameLabel ,
457
457
)
458
458
}
0 commit comments