mirror of https://github.com/docker/compose.git
Merge pull request #1487 from docker/cli-source
make metrics' source configuration (see compose-switch)
This commit is contained in:
commit
78660493ca
|
@ -22,6 +22,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -37,9 +38,16 @@ type Command struct {
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CLISource is sent for cli metrics
|
||||||
|
var CLISource = "cli"
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
if v, ok := os.LookupEnv("DOCKER_METRICS_SOURCE"); ok {
|
||||||
|
CLISource = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// CLISource is sent for cli metrics
|
|
||||||
CLISource = "cli"
|
|
||||||
// APISource is sent for API metrics
|
// APISource is sent for API metrics
|
||||||
APISource = "api"
|
APISource = "api"
|
||||||
// SuccessStatus is sent for API metrics
|
// SuccessStatus is sent for API metrics
|
||||||
|
|
Loading…
Reference in New Issue