forked from TrueCloudLab/frostfs-node
[#373] metrics: Move labels to consts
To unify label naming all lable keys and other consts are moved to one file. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
b5d9f4a285
commit
03aa210145
13 changed files with 119 additions and 160 deletions
|
@ -17,24 +17,24 @@ func newShardIDMode(subsystem, name, help string) *shardIDModeValue {
|
|||
Subsystem: subsystem,
|
||||
Name: name,
|
||||
Help: help,
|
||||
}, []string{wcShardID, wcMode}),
|
||||
}, []string{shardIDLabel, modeLabel}),
|
||||
}
|
||||
}
|
||||
|
||||
func (m *shardIDModeValue) SetMode(shardID string, mode string) {
|
||||
m.modeValue.DeletePartialMatch(prometheus.Labels{
|
||||
wcShardID: shardID,
|
||||
shardIDLabel: shardID,
|
||||
})
|
||||
|
||||
m.modeValue.With(prometheus.Labels{
|
||||
wcShardID: shardID,
|
||||
wcMode: mode,
|
||||
shardIDLabel: shardID,
|
||||
modeLabel: mode,
|
||||
}).Set(1)
|
||||
}
|
||||
|
||||
func (m *shardIDModeValue) Delete(shardID string) {
|
||||
m.modeValue.DeletePartialMatch(prometheus.Labels{
|
||||
wcShardID: shardID,
|
||||
shardIDLabel: shardID,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue