@@ -54,14 +54,16 @@ const (
54
54
memoryThreadLabel = "thread"
55
55
memoryThreadIDLabel = "threadID"
56
56
57
- memoryObjectsMetric = "objects"
58
- memoryUsedMetric = "used"
59
- memoryTotalMetric = "total"
60
- memoryFreeMetric = "free"
61
- memoryReclaimedMetric = "reclaimed"
62
- memoryOverheadMetric = "overhead"
63
- memorySizeMetric = "size"
64
- memoryPagesMetric = "pages"
57
+ memoryObjectsMetric = "objects"
58
+ memoryUsedMetric = "used"
59
+ memoryTotalMetric = "total"
60
+ memoryFreeMetric = "free"
61
+ memoryTrimmableMetric = "trimmable"
62
+ memoryFreeChunksMetric = "free_chunks"
63
+ memoryFreeFastbinBlksMetric = "free_fastbin_blks"
64
+ memoryMaxTotalAlloc = "max_total_allocated"
65
+ memorySizeMetric = "size"
66
+ memoryPagesMetric = "pages"
65
67
)
66
68
67
69
// Buffers metrics
@@ -181,7 +183,6 @@ func (p *Plugin) registerPrometheus() error {
181
183
agentLabel : p .ServiceLabel .GetAgentLabel (),
182
184
},
183
185
}, []string {runtimeItemLabel , runtimeThreadLabel , runtimeThreadIDLabel })
184
-
185
186
}
186
187
187
188
// register created vectors to prometheus
@@ -201,10 +202,12 @@ func (p *Plugin) registerPrometheus() error {
201
202
{memoryUsedMetric , "Used memory" },
202
203
{memoryTotalMetric , "Total memory" },
203
204
{memoryFreeMetric , "Free memory" },
204
- {memoryReclaimedMetric , "Reclaimed memory" },
205
- {memoryOverheadMetric , "Overhead" },
206
205
{memorySizeMetric , "Size" },
207
206
{memoryPagesMetric , "Pages" },
207
+ {memoryTrimmableMetric , "Trimmable" },
208
+ {memoryFreeChunksMetric , "Free Chunks" },
209
+ {memoryFreeFastbinBlksMetric , "Free Fastbin Bulks" },
210
+ {memoryMaxTotalAlloc , "Max Total Allocations" },
208
211
} {
209
212
name := metric [0 ]
210
213
p .memoryGaugeVecs [name ] = prometheus .NewGaugeVec (prometheus.GaugeOpts {
@@ -443,14 +446,15 @@ func (p *Plugin) updatePrometheus(ctx context.Context) {
443
446
}
444
447
}
445
448
446
- stats .metrics [memoryObjectsMetric ].Set (float64 (thread .Objects ))
447
449
stats .metrics [memoryUsedMetric ].Set (float64 (thread .Used ))
448
450
stats .metrics [memoryTotalMetric ].Set (float64 (thread .Total ))
449
451
stats .metrics [memoryFreeMetric ].Set (float64 (thread .Free ))
450
- stats .metrics [memoryReclaimedMetric ].Set (float64 (thread .Reclaimed ))
451
- stats .metrics [memoryOverheadMetric ].Set (float64 (thread .Overhead ))
452
452
stats .metrics [memorySizeMetric ].Set (float64 (thread .Size ))
453
453
stats .metrics [memoryPagesMetric ].Set (float64 (thread .Pages ))
454
+ stats .metrics [memoryTrimmableMetric ].Set (float64 (thread .Trimmable ))
455
+ stats .metrics [memoryFreeChunksMetric ].Set (float64 (thread .FreeChunks ))
456
+ stats .metrics [memoryFreeFastbinBlksMetric ].Set (float64 (thread .FreeFastbinBlks ))
457
+ stats .metrics [memoryMaxTotalAlloc ].Set (float64 (thread .MaxTotalAlloc ))
454
458
}
455
459
}
456
460
}
0 commit comments