From 0d65baf6e457583e6f74ddc1eb01e859c7d4c203 Mon Sep 17 00:00:00 2001 From: Jordan Neufeld Date: Tue, 1 Mar 2022 15:03:25 -0600 Subject: [PATCH] rename metrics flags --- METRICS.md | 4 ++-- cmd/server/server.go | 4 ++-- scripts/test-e2e | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/METRICS.md b/METRICS.md index 1e161c01a..55111b82c 100644 --- a/METRICS.md +++ b/METRICS.md @@ -7,7 +7,7 @@ ### Runtime Metrics -To enable runtime metrics related to the state of the go runtime, build version, process info, use the `-enable-runtime-metrics` flag. +To enable runtime metrics related to the state of the go runtime, build version, process info, use the `-runtime-metrics` flag. For more details, see below: - [NewGoCollector](https://pkg.go.dev/github.com/prometheus/client_golang/prometheus/collectors#NewGoCollector) @@ -16,7 +16,7 @@ For more details, see below: ### Proxy Metrics -To enable metrics related to toxiproxy internals, use the `-enable-proxy-metrics` flag. +To enable metrics related to toxiproxy internals, use the `-proxy-metrics` flag. #### toxiproxy_proxy_received_bytes_total / toxiproxy_proxy_sent_bytes_total The total number of bytes received/sent on a given proxy link in a given direction diff --git a/cmd/server/server.go b/cmd/server/server.go index f0b775275..2f41fa8ea 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -37,9 +37,9 @@ func parseArguments() cliArguments { "JSON file containing proxies to create on startup") flag.Int64Var(&result.seed, "seed", time.Now().UTC().UnixNano(), "Seed for randomizing toxics with") - flag.BoolVar(&result.runtimeMetrics, "enable-runtime-metrics", false, + flag.BoolVar(&result.runtimeMetrics, "runtime-metrics", false, `enable runtime-related prometheus metrics (default "false")`) - flag.BoolVar(&result.proxyMetrics, "enable-proxy-metrics", false, + flag.BoolVar(&result.proxyMetrics, "proxy-metrics", false, `enable toxiproxy-specific prometheus metrics (default "false")`) flag.BoolVar(&result.printVersion, "version", false, `print the version (default "false")`) diff --git a/scripts/test-e2e b/scripts/test-e2e index 5a5a17527..77a4d6cc0 100755 --- a/scripts/test-e2e +++ b/scripts/test-e2e @@ -8,7 +8,7 @@ wait_for_url() { } # Stop all background jobs on exit -trap 'pkill -15 -f "dist/toxiproxy-server -enable-proxy-metrics -enable-runtime-metrics$"; pkill -15 -f "exe/endpoint$"' \ +trap 'pkill -15 -f "dist/toxiproxy-server -proxy-metrics -runtime-metrics$"; pkill -15 -f "exe/endpoint$"' \ EXIT SIGINT SIGTERM echo "=== Starting Web service" @@ -17,7 +17,7 @@ go run test/e2e/endpoint.go 2>&1 | sed -e 's/^/[web] /' & echo "=== Starting Toxiproxy" -LOG_LEVEL=debug ./dist/toxiproxy-server -enable-proxy-metrics -enable-runtime-metrics 2>&1 | sed -e 's/^/[toxiproxy] /' & +LOG_LEVEL=debug ./dist/toxiproxy-server -proxy-metrics -runtime-metrics 2>&1 | sed -e 's/^/[toxiproxy] /' & echo "=== Wait when service are available"