-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logcli: replaced GRAFANA_* with LOKI_* in logcli env vars, set default server url for logcli to localhost #1492
logcli: replaced GRAFANA_* with LOKI_* in logcli env vars, set default server url for logcli to localhost #1492
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
… url for logcli to localhost
3efe6ee
to
babf11b
Compare
cmd/logcli/main.go
Outdated
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("addr", "Server address.").Default("http://localhost:3100").Envar("LOKI_ADDR").Action(addressAction).StringVar(&client.Address) | ||
app.Flag("username", "Username for HTTP basic auth.").Default("").Envar("LOKI_USERNAME").StringVar(&client.Username) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to document this in the help strings as well, eg. Username for HTTP basic auth. Uses LOKI_USERNAME from environment, if set.
I didn't know until now that logcli already supports this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a fair, @sandlis can you update the flag description ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added it. Please check.
Thanks!
cmd/logcli/main.go
Outdated
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to capitalize "env var". Also, should be "environment variable", but that is perhaps too long.
…grafana#1492) Signed-off-by: Marco Pracucci <[email protected]>
What this PR does / why we need it:
Checklist