Skip to content

Commit

Permalink
incorporate requested changes
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Richter <crichter@owncloud.com>
  • Loading branch information
dragonchaser committed Sep 27, 2022
1 parent 5af4624 commit 45a367a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
5 changes: 0 additions & 5 deletions changelog/unreleased/add-s3ng-metrics.md

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/storage/fs/s3ng/blobstore/blobstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type Blobstore struct {
bucket string
}

// PrometheusAwareReader provides an interface to an prometheus aweare Reader
// PrometheusAwareReader provides an interface to an prometheus aware Reader
type PrometheusAwareReader struct {
r io.Reader
m *prometheus.CounterVec
Expand Down
15 changes: 12 additions & 3 deletions pkg/storage/fs/s3ng/blobstore/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@

package blobstore

import "github.com/prometheus/client_golang/prometheus"
import (
"github.com/prometheus/client_golang/prometheus"
"go-micro.dev/v4/util/log"
)

var (
// Namespace defines the namespace for the defines metrics.
Expand Down Expand Up @@ -50,8 +53,14 @@ func NewMetrics() *Metrics {
Help: "Storage access tx",
}, []string{}),
}
_ = prometheus.Register(m.Rx)
_ = prometheus.Register(m.Tx)
err := prometheus.Register(m.Rx)
if err != nil {
log.Errorf("Failed to register prometheus storage rx Counter (%s)", err)
}
err = prometheus.Register(m.Tx)
if err != nil {
log.Errorf("Failed to register prometheus storage tx Counter (%s)", err)
}

return m
}

0 comments on commit 45a367a

Please sign in to comment.