[#1653] blobstor: Add IO tag label to metrics
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
3a6a58b163
commit
fae4040433
12 changed files with 65 additions and 42 deletions
|
@ -12,7 +12,7 @@ type BlobstoreMetrics interface {
|
|||
SetMode(shardID string, readOnly bool)
|
||||
Close(shardID string)
|
||||
|
||||
MethodDuration(shardID string, method string, d time.Duration, success bool, withStorageID NullBool)
|
||||
MethodDuration(shardID string, method string, d time.Duration, success bool, withStorageID NullBool, ioTag string)
|
||||
AddPut(shardID string, size int)
|
||||
AddGet(shardID string, size int)
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ func newBlobstoreMetrics() *blobstoreMetrics {
|
|||
Subsystem: blobstoreSubSystem,
|
||||
Name: "request_duration_seconds",
|
||||
Help: "Accumulated Blobstore request process duration",
|
||||
}, []string{shardIDLabel, successLabel, methodLabel, withStorageIDLabel}),
|
||||
}, []string{shardIDLabel, successLabel, methodLabel, withStorageIDLabel, ioTagLabel}),
|
||||
put: metrics.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: namespace,
|
||||
Subsystem: blobstoreSubSystem,
|
||||
|
@ -65,12 +65,13 @@ func (m *blobstoreMetrics) Close(shardID string) {
|
|||
})
|
||||
}
|
||||
|
||||
func (m *blobstoreMetrics) MethodDuration(shardID string, method string, d time.Duration, success bool, withStorageID NullBool) {
|
||||
func (m *blobstoreMetrics) MethodDuration(shardID string, method string, d time.Duration, success bool, withStorageID NullBool, ioTag string) {
|
||||
m.reqDuration.With(prometheus.Labels{
|
||||
shardIDLabel: shardID,
|
||||
successLabel: strconv.FormatBool(success),
|
||||
methodLabel: method,
|
||||
withStorageIDLabel: withStorageID.String(),
|
||||
ioTagLabel: ioTag,
|
||||
}).Observe(d.Seconds())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue