-
Notifications
You must be signed in to change notification settings - Fork 179
Added metric for symbol table size #375
Added metric for symbol table size #375
Conversation
Signed-off-by: Ganesh Vernekar <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 @brian-brazil Do you still want this?
db.mtx.RUnlock() | ||
symTblSize := float64(0) | ||
for _, b := range blocks { | ||
symTblSize += float64(b.GetSymbolTableSize()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid too many conversions, symTblSize := 0
and then return float64(symTblSize)
@@ -138,6 +139,19 @@ func newDBMetrics(db *DB, r prometheus.Registerer) *dbMetrics { | |||
defer db.mtx.RUnlock() | |||
return float64(len(db.blocks)) | |||
}) | |||
m.symbolTableSize = prometheus.NewGaugeFunc(prometheus.GaugeOpts{ | |||
Name: "prometheus_tsdb_symbol_table_size", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See: https://prometheus.io/docs/practices/naming/#metric-names
Should be prometheus_tsdb_symbol_table_size_bytes
Yes, it's a way to spot high cardinality issues. |
Note that this is |
I think the total's fine. |
Thanks for the input! |
Closes #244, Supersedes #272
prometheus_tsdb_symbol_table_size
will show the total size of symbol table of persisted blocks.Signed-off-by: Ganesh Vernekar [email protected]