Skip to content

Commit 75c155b

Browse files
authored
Merge pull request #73 from Chengxuan/update-metrics
Pick up latest metrics code
2 parents 6c0c0d1 + f8ab92b commit 75c155b

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/go-resty/resty/v2 v2.7.0
1010
github.com/gorilla/mux v1.8.0
1111
github.com/gorilla/websocket v1.5.0
12-
github.com/hyperledger/firefly-common v1.2.6
12+
github.com/hyperledger/firefly-common v1.2.7
1313
github.com/oklog/ulid/v2 v2.1.0
1414
github.com/prometheus/client_golang v1.13.0
1515
github.com/sirupsen/logrus v1.9.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T
184184
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
185185
github.com/huandu/xstrings v1.3.1 h1:4jgBlKK6tLKFvO8u5pmYjG91cqytmDCDvGh7ECVFfFs=
186186
github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
187-
github.com/hyperledger/firefly-common v1.2.6 h1:NDf42a2iH6QSt3p7KkdT1pTDoW/NljcT+ClEfZRh61c=
188-
github.com/hyperledger/firefly-common v1.2.6/go.mod h1:uYO8DMgT3OGoF2R4Bew1Ql4BS3udYGzPs59sJH1V3E4=
187+
github.com/hyperledger/firefly-common v1.2.7 h1:voFbNVRFHZ64EJbyxCtMbLLriNRyqrl+wdUEqpgexHs=
188+
github.com/hyperledger/firefly-common v1.2.7/go.mod h1:uYO8DMgT3OGoF2R4Bew1Ql4BS3udYGzPs59sJH1V3E4=
189189
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
190190
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
191191
github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=

internal/metrics/metrics.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package metrics
1818

1919
import (
2020
"context"
21-
"fmt"
2221
"net/http"
2322
"time"
2423

@@ -29,11 +28,11 @@ import (
2928
"github.com/prometheus/client_golang/prometheus/promhttp"
3029
)
3130

32-
const metricsTransactionManagerPrefix = "tm"
31+
const metricsTransactionManagerComponentName = "transaction_manager"
3332

3433
// REST api-server and transaction handler are sub-subsystem
35-
var metricsTransactionHandlerSubsystemName = fmt.Sprintf("%s_%s", metricsTransactionManagerPrefix, "th")
36-
var metricsRESTAPIServerSubSystemName = fmt.Sprintf("%s_%s", metricsTransactionManagerPrefix, "api_server_rest")
34+
var metricsTransactionHandlerSubsystemName = "th"
35+
var metricsRESTAPIServerSubSystemName = "api_server_rest"
3736

3837
type metricsManager struct {
3938
ctx context.Context
@@ -44,7 +43,7 @@ type metricsManager struct {
4443
}
4544

4645
func NewMetricsManager(ctx context.Context) Metrics {
47-
metricsRegistry := metric.NewPrometheusMetricsRegistry()
46+
metricsRegistry := metric.NewPrometheusMetricsRegistry(metricsTransactionManagerComponentName)
4847
txHandlerMetricsManager, _ := metricsRegistry.NewMetricsManagerForSubsystem(ctx, metricsTransactionHandlerSubsystemName)
4948
_ = metricsRegistry.NewHTTPMetricsInstrumentationsForSubsystem(
5049
ctx,

0 commit comments

Comments
 (0)