diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a5714f48ecbe..27e93efda5bed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Notable Changes * [1486](https://github.com/grafana/loki/pull/1486) **pracucci**: Deprecated `-distributor.limiter-reload-period` flag / distributor's `limiter_reload_period` config option. +* [1492](https://github.com/grafana/loki/pull/1492) **sandlis**: replaced GRAFANA_* with LOKI_* in logcli env vars, set default server url for logcli to http://localhost:3100. ### Features diff --git a/cmd/logcli/main.go b/cmd/logcli/main.go index 017be88881cee..a81343da5eb2d 100644 --- a/cmd/logcli/main.go +++ b/cmd/logcli/main.go @@ -109,13 +109,13 @@ func newQueryClient(app *kingpin.Application) *client.Client { return nil } - app.Flag("addr", "Server address.").Default("https://logs-us-west1.grafana.net").Envar("GRAFANA_ADDR").Action(addressAction).StringVar(&client.Address) - app.Flag("username", "Username for HTTP basic auth.").Default("").Envar("GRAFANA_USERNAME").StringVar(&client.Username) - app.Flag("password", "Password for HTTP basic auth.").Default("").Envar("GRAFANA_PASSWORD").StringVar(&client.Password) - app.Flag("ca-cert", "Path to the server Certificate Authority.").Default("").Envar("LOKI_CA_CERT_PATH").StringVar(&client.TLSConfig.CAFile) + app.Flag("addr", "Server address. Can also be set using LOKI_ADDR env var.").Default("http://localhost:3100").Envar("LOKI_ADDR").Action(addressAction).StringVar(&client.Address) + app.Flag("username", "Username for HTTP basic auth. Can also be set using LOKI_USERNAME env var.").Default("").Envar("LOKI_USERNAME").StringVar(&client.Username) + app.Flag("password", "Password for HTTP basic auth. Can also be set using LOKI_PASSWORD env var.").Default("").Envar("LOKI_PASSWORD").StringVar(&client.Password) + app.Flag("ca-cert", "Path to the server Certificate Authority. Can also be set using LOKI_CA_CERT_PATH env var.").Default("").Envar("LOKI_CA_CERT_PATH").StringVar(&client.TLSConfig.CAFile) app.Flag("tls-skip-verify", "Server certificate TLS skip verify.").Default("false").BoolVar(&client.TLSConfig.InsecureSkipVerify) - app.Flag("cert", "Path to the client certificate.").Default("").Envar("LOKI_CLIENT_CERT_PATH").StringVar(&client.TLSConfig.CertFile) - app.Flag("key", "Path to the client certificate key.").Default("").Envar("LOKI_CLIENT_KEY_PATH").StringVar(&client.TLSConfig.KeyFile) + app.Flag("cert", "Path to the client certificate. Can also be set using LOKI_CLIENT_CERT_PATH env var.").Default("").Envar("LOKI_CLIENT_CERT_PATH").StringVar(&client.TLSConfig.CertFile) + app.Flag("key", "Path to the client certificate key. Can also be set using LOKI_CLIENT_KEY_PATH env var.").Default("").Envar("LOKI_CLIENT_KEY_PATH").StringVar(&client.TLSConfig.KeyFile) return client } diff --git a/docs/getting-started/logcli.md b/docs/getting-started/logcli.md index dc0cb8fd6f08b..422bb08fbc017 100644 --- a/docs/getting-started/logcli.md +++ b/docs/getting-started/logcli.md @@ -25,21 +25,21 @@ $ go get github.com/grafana/loki/cmd/logcli If you are running on Grafana Cloud, use: ```bash -$ export GRAFANA_ADDR=https://logs-us-west1.grafana.net -$ export GRAFANA_USERNAME= -$ export GRAFANA_PASSWORD= +$ export LOKI_ADDR=https://logs-us-west1.grafana.net +$ export LOKI_USERNAME= +$ export LOKI_PASSWORD= ``` Otherwise you can point LogCLI to a local instance directly without needing a username and password: ```bash -$ export GRAFANA_ADDR=http://localhost:3100 +$ export LOKI_ADDR=http://localhost:3100 ``` > Note: If you are running Loki behind a proxy server and you have -> authentication configured, you will also have to pass in GRAFANA_USERNAME -> and GRAFANA_PASSWORD accordingly. +> authentication configured, you will also have to pass in LOKI_USERNAME +> and LOKI_PASSWORD accordingly. ```bash $ logcli labels job