Skip to content

Commit a7c0f77

Browse files
committed
Change metrics activation
1 parent 7a9c988 commit a7c0f77

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

metrics/metrics.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"encoding/hex"
2222
"net/http"
2323

24-
"github.com/arduino/arduino-cli/configuration"
2524
"github.com/arduino/arduino-cli/inventory"
2625
"github.com/segmentio/stats/v4"
2726
"github.com/segmentio/stats/v4/prometheus"
@@ -32,7 +31,7 @@ import (
3231
var serverPattern = "/metrics"
3332

3433
// Activate configures and starts the metrics server exposing a Prometheus resource
35-
func Activate(metricPrefix string) {
34+
func Activate(metricPrefix, serverAddr string) {
3635
// Create a Prometheus default handler
3736
ph := prometheus.DefaultHandler
3837
// Create a new stats engine with an engine that prepends the "daemon" prefix to all metrics
@@ -42,8 +41,6 @@ func Activate(metricPrefix string) {
4241
// Register the handler so it receives metrics from the default engine.
4342
stats.Register(ph)
4443

45-
// Configure using viper settings
46-
serverAddr := configuration.Settings.GetString("metrics.addr")
4744
logrus.Infof("Setting up Prometheus metrics on %s%s", serverAddr, serverPattern)
4845
go func() {
4946
http.Handle(serverPattern, ph)

0 commit comments

Comments
 (0)