Skip to content
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

Merged
merged 4 commits into from
Jan 20, 2020

Conversation

sandeepsukhani
Copy link
Contributor

@sandeepsukhani sandeepsukhani commented Jan 9, 2020

What this PR does / why we need it:

  1. Renamed logcli env vars:
  • GRAFANA_ADDR -> LOKI_ADDR
  • GRAFANA_USERNAME -> LOKI_USERNAME
  • GRAFANA_PASSWORD -> LOKI_PASSWORD
  1. Change the default value of LOKI_ADDR to http://localhost:3100

Checklist

  • Documentation updated
  • Changelog updated

Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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)
Copy link
Member

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.

Copy link
Contributor

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 ?

Copy link
Contributor Author

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!

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)
Copy link
Member

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.

@sandeepsukhani sandeepsukhani merged commit 2ae8bb2 into grafana:master Jan 20, 2020
@sandeepsukhani sandeepsukhani deleted the logcli-env-vars-rename branch January 20, 2020 06:59
cyriltovena pushed a commit to cyriltovena/loki that referenced this pull request Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants