Skip to content

Commit

Permalink
update usage info
Browse files Browse the repository at this point in the history
  • Loading branch information
marriva committed Jun 21, 2022
1 parent b9df73b commit 37bd975
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@ usage: clickhouse-exporter [<flags>]
Flags:
-h, --help Show context-sensitive help (also try --help-long and --help-man).
--chi-name="localhost"
Clickhouse cluster name.
--namespace="default" The namespace label for metrics.
--chi-name="MacBook-Pro.local"
Clickhouse cluster name or $HOSTNAME.
--namespace="default" The namespace label for metrics or $NAMESPACE.
--metrics-endpoint=":8888"
The Prometheus exporter endpoint.
--chi-list-endpoint=":8888"
The CHI list endpoint.
--scheme=http Clickhouse HTTP scheme.
--username="default" Clickhouse username.
--password="" Clickhouse user password.
--port=8123 Clickhouse HTTP port number.
--scheme=http Clickhouse HTTP scheme or $CH_SCHEME
--username="default" Clickhouse username or $CH_USERNAME.
--password="" Clickhouse user password or $CH_PASSWORD.
--port=8123 Clickhouse HTTP port number or $CH_PORT.
--address=127.0.0.1 ... A list of Clickhouse hosts
--log-level=info Only log messages with the given severity or above. Valid levels: [debug, info, warn,
error, fatal]
--log-level=info Only log messages with the given severity or above. Valid levels: [debug, info, warn, error, fatal]
--log-format=json Set the log format. Valid formats: [json, text]
--version Show application version.
```
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ var (

func init() {
host, _ := os.Hostname()
kingpin.Flag("chi-name", "Clickhouse cluster name.").
Default(host).StringVar(&chiName)
kingpin.Flag("namespace", "The namespace label for metrics.").
kingpin.Flag("chi-name", "Clickhouse cluster name or $HOSTNAME.").
Default(host).Envar("HOSTNAME").StringVar(&chiName)
kingpin.Flag("namespace", "The namespace label for metrics or $NAMESPACE.").
Default(defaultNamespace).Envar("NAMESPACE").StringVar(&namespace)
kingpin.Flag("metrics-endpoint", "The Prometheus exporter endpoint.").
Default(defaultMetricsEndpoint).StringVar(&metricsEP)
kingpin.Flag("chi-list-endpoint", "The CHI list endpoint.").
Default(defaultChiListEP).StringVar(&chiListEP)
kingpin.Flag("scheme", "Clickhouse HTTP scheme.").
kingpin.Flag("scheme", "Clickhouse HTTP scheme or $CH_SCHEME").
Default(defaultChScheme).Envar("CH_SCHEME").EnumVar(&scheme, "http", "https")
kingpin.Flag("username", "Clickhouse username.").
kingpin.Flag("username", "Clickhouse username or $CH_USERNAME.").
Default(defaultChUser).Envar("CH_USERNAME").StringVar(&username)
kingpin.Flag("password", "Clickhouse user password.").
kingpin.Flag("password", "Clickhouse user password or $CH_PASSWORD.").
Default(defaultChPass).Envar("CH_PASSWORD").StringVar(&password)
kingpin.Flag("port", "Clickhouse HTTP port number.").
kingpin.Flag("port", "Clickhouse HTTP port number or $CH_PORT.").
Default(defaultChPort).Envar("CH_PORT").IntVar(&port)
kingpin.Flag("address", "A list of Clickhouse hosts").
Default(defaultChHost).StringsVar(&hostnames)
Expand Down

0 comments on commit 37bd975

Please sign in to comment.