Skip to content

Commit 1ac773a

Browse files
committed
Use labels pattern
Signed-off-by: Felix Yuan <[email protected]>
1 parent dc77ffd commit 1ac773a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

collector/pg_index_size.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ func (PGIndexSizeCollector) Update(ctx context.Context, instance *instance, ch c
8686
if indexrelname.Valid {
8787
indexrelnameLabel = indexrelname.String
8888
}
89+
labels := []string{schemanameLabel, relnameLabel, indexrelnameLabel}
8990

9091
indexSizeMetric := 0.0
9192
if indexSize.Valid {
@@ -95,7 +96,7 @@ func (PGIndexSizeCollector) Update(ctx context.Context, instance *instance, ch c
9596
indexSizeDesc,
9697
prometheus.GaugeValue,
9798
indexSizeMetric,
98-
schemanameLabel, relnameLabel, indexrelnameLabel,
99+
labels...,
99100
)
100101
}
101102
if err := rows.Err(); err != nil {

0 commit comments

Comments
 (0)