-
Notifications
You must be signed in to change notification settings - Fork 3
add cache storage metrics #1195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -270,6 +271,12 @@ func SetMonitoringActive(isActive bool) { | |||
}, []string{"status"}) | |||
prometheus.MustRegister(dbStatGaugeVector) | |||
|
|||
// Cache Storage | |||
cacheStorageCounter = prometheus.NewGaugeVec(prometheus.GaugeOpts{ | |||
Name: "cache_storage_counter", |
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.
IMO it's better to prefix the name with zoobc_
so that we can easily find the metrics in grafana
cacheStorageCounter = prometheus.NewGaugeVec(prometheus.GaugeOpts{ | ||
Name: "cache_storage_counter", | ||
Help: "Cache Storage counter", | ||
}, []string{"mempools", "batch_receipts", "scramble_nodes", "backup_mempools", "node_shards"}) |
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.
IMO this is enough with 1 bucket []string{"storage_type"}
@@ -270,6 +271,12 @@ func SetMonitoringActive(isActive bool) { | |||
}, []string{"status"}) | |||
prometheus.MustRegister(dbStatGaugeVector) | |||
|
|||
// Cache Storage | |||
cacheStorageCounter = prometheus.NewGaugeVec(prometheus.GaugeOpts{ |
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.
IMO better to name it cacheStorageGaugeVector
to be able to understand it easily at a glance. what do you think?
switch cacheType { | ||
case TypeMempoolCacheStorage: | ||
cacheStorageCounter.WithLabelValues(string(cacheType)).Set(size) | ||
case TypeBatchReceiptCacheStorage: | ||
cacheStorageCounter.WithLabelValues(string(cacheType)).Set(size) | ||
case TypeScrambleNodeCacheStorage: | ||
cacheStorageCounter.WithLabelValues(string(cacheType)).Set(size) | ||
case TypeMempoolBackupCacheStorage: | ||
cacheStorageCounter.WithLabelValues(string(cacheType)).Set(size) | ||
case TypeNodeShardCacheStorage: | ||
cacheStorageCounter.WithLabelValues(string(cacheType)).Set(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.
I think we don't need this switch case. doing it cacheStorageCounter.WithLabelValues(string(cacheType)).Set(size)
I think is enough
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.
ah, sorry. will update now
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.
already updated @capt4ce
Description
Need to add metrics part for cache storage, that will be cool in grafana dashboard.
Showing size in bytes.
Already in is: