[loki-canary] Support passing loki address as environment variable (#8205)

pull/8227/head
Jijo Thomas John 2 years ago committed by GitHub
parent db3a9c961e
commit 54f09b89fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      cmd/loki-canary/main.go
  2. 9
      docs/sources/operations/loki-canary/_index.md

@ -95,7 +95,11 @@ func main() {
} }
if *addr == "" { if *addr == "" {
_, _ = fmt.Fprintf(os.Stderr, "Must specify a Loki address with -addr\n") *addr = os.Getenv("LOKI_ADDRESS")
}
if *addr == "" {
_, _ = fmt.Fprintf(os.Stderr, "Must specify a Loki address with -addr or set the environemnt variable LOKI_ADDRESS\n")
os.Exit(1) os.Exit(1)
} }

@ -272,9 +272,10 @@ $ make loki-canary-image
## Configuration ## Configuration
The address of Loki must be passed in with the `-addr` flag, and if your Loki The address of Loki must be passed in with the `-addr` flag or by setting the
server uses TLS, `-tls=true` must also be provided. Note that using TLS will environment variable `LOKI_ADDRESS`, and if your Loki server uses TLS, `-tls=true`
cause the WebSocket connection to use `wss://` instead of `ws://`. must also be provided. Note that using TLS will cause the WebSocket connection
to use `wss://` instead of `ws://`.
The `-labelname` and `-labelvalue` flags should also be provided, as these are The `-labelname` and `-labelvalue` flags should also be provided, as these are
used by Loki Canary to filter the log stream to only process logs for the used by Loki Canary to filter the log stream to only process logs for the
@ -302,7 +303,7 @@ All options:
``` ```
-addr string -addr string
The Loki server URL:Port, e.g. loki:3100 The Loki server URL:Port, e.g. loki:3100. Loki address can also be set using the environment variable LOKI_ADDRESS.
-buckets int -buckets int
Number of buckets in the response_latency histogram (default 10) Number of buckets in the response_latency histogram (default 10)
-ca-file string -ca-file string

Loading…
Cancel
Save