@@ -150,15 +150,15 @@ var (
150150 []string {"datname" , "schemaname" , "relname" },
151151 prometheus.Labels {},
152152 )
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" ,
156156 []string {"datname" , "schemaname" , "relname" },
157157 prometheus.Labels {},
158158 )
159- statUserTablesOnlySize = prometheus .NewDesc (
159+ statUserTableSize = prometheus .NewDesc (
160160 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" ,
162162 []string {"datname" , "schemaname" , "relname" },
163163 prometheus.Labels {},
164164 )
@@ -205,10 +205,10 @@ func (c *PGStatUserTablesCollector) Update(ctx context.Context, instance *instan
205205 for rows .Next () {
206206 var datname , schemaname , relname sql.NullString
207207 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
209209 var lastVacuum , lastAutovacuum , lastAnalyze , lastAutoanalyze sql.NullTime
210210
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 {
212212 return err
213213 }
214214
@@ -434,25 +434,25 @@ func (c *PGStatUserTablesCollector) Update(ctx context.Context, instance *instan
434434 datnameLabel , schemanameLabel , relnameLabel ,
435435 )
436436
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 )
440440 }
441441 ch <- prometheus .MustNewConstMetric (
442- statUserTablesTotalSize ,
442+ statUserIndexSize ,
443443 prometheus .GaugeValue ,
444- totalSizeMetric ,
444+ indexSizeMetric ,
445445 datnameLabel , schemanameLabel , relnameLabel ,
446446 )
447447
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 )
451451 }
452452 ch <- prometheus .MustNewConstMetric (
453- statUserTablesOnlySize ,
453+ statUserTableSize ,
454454 prometheus .GaugeValue ,
455- tableOnlySizeMetric ,
455+ tableSizeMetric ,
456456 datnameLabel , schemanameLabel , relnameLabel ,
457457 )
458458 }
0 commit comments