Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions rolling-shutter/keyper/keypermetrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ var MetricsKeyperBatchConfigInfo = prometheus.NewGaugeVec(
Name: "batch_config_info",
Help: "Information about the batch configuration in use",
},
[]string{"batch_config_index", "keyper_addresses"})
[]string{"batch_config_index", "keyper_addresses", "keyper_count", "threshold"},
)

var MetricsKeyperDKGStatus = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Expand Down Expand Up @@ -199,7 +200,12 @@ func InitMetrics(dbpool *pgxpool.Pool, config kprconfig.Config) {

// Join keyper addresses for the label
keyperAddresses := strings.Join(batchConfig.Keypers, ",")
MetricsKeyperBatchConfigInfo.WithLabelValues(batchConfigIndexStr, keyperAddresses).Set(1)

keyperCount := strconv.Itoa(len(batchConfig.Keypers))

threshold := strconv.FormatInt(int64(batchConfig.Threshold), 10)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why you use FormatInt here, but in the line above Itoa?


MetricsKeyperBatchConfigInfo.WithLabelValues(batchConfigIndexStr, keyperAddresses, keyperCount, threshold).Set(1)

// Check if current node is a keyper in this batch config
isKeyper := false
Expand Down
7 changes: 6 additions & 1 deletion rolling-shutter/keyper/smobserver/smstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,12 @@ func (st *ShuttermintState) handleBatchConfig(
for _, k := range e.Keypers {
keypers = append(keypers, shdb.EncodeAddress(k))
}
keypermetrics.MetricsKeyperBatchConfigInfo.WithLabelValues(strconv.FormatUint(e.KeyperConfigIndex, 10), strings.Join(keypers, ",")).Set(1)
keypermetrics.MetricsKeyperBatchConfigInfo.WithLabelValues(
strconv.FormatUint(e.KeyperConfigIndex, 10),
strings.Join(keypers, ","),
strconv.Itoa(len(e.Keypers)),
strconv.FormatUint(e.Threshold, 10),
).Set(1)
if err := queries.InsertBatchConfig(
ctx,
database.InsertBatchConfigParams{
Expand Down