Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 7866049

Browse files
authored
Merge pull request #1487 from docker/cli-source
make metrics' source configuration (see compose-switch)
2 parents d625f08 + 0cd080a commit 7866049

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

cli/metrics/client.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"encoding/json"
2323
"net"
2424
"net/http"
25+
"os"
2526
"time"
2627
)
2728

@@ -37,9 +38,16 @@ type Command struct {
3738
Status string `json:"status"`
3839
}
3940

41+
// CLISource is sent for cli metrics
42+
var CLISource = "cli"
43+
44+
func init() {
45+
if v, ok := os.LookupEnv("DOCKER_METRICS_SOURCE"); ok {
46+
CLISource = v
47+
}
48+
}
49+
4050
const (
41-
// CLISource is sent for cli metrics
42-
CLISource = "cli"
4351
// APISource is sent for API metrics
4452
APISource = "api"
4553
// SuccessStatus is sent for API metrics

0 commit comments

Comments
 (0)