Pass prometheus dump path and port to analyzer script (#2665)

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Sanket Sudake
2022-12-09 15:16:51 +05:30
committed by GitHub
parent 61d98152f1
commit d16de59e9f
2 changed files with 21 additions and 2 deletions
+6 -1
View File
@@ -30,6 +30,7 @@ function prom_context() {
if [ -z "$PROM_CONTEXT" ]; then
exit_error "PROM_CONTEXT not set"
fi
echo "Prometheus context: $PROM_CONTEXT"
}
function list_context() {
@@ -113,7 +114,7 @@ function prometheus_run() {
--config.file=$ETC_PROM/config_out/prometheus.env.yaml \
--storage.tsdb.path=${TSDB_PATH}/ \
--web.enable-lifecycle \
--web.listen-address=127.0.0.1:9090 \
--web.listen-address=127.0.0.1:${PROM_PORT:-9090} \
--web.route-prefix=/ \
--storage.tsdb.wal-compression \
--web.config.file=$ETC_PROM/web_config/web-config.yaml
@@ -185,6 +186,10 @@ while getopts ${optstring} arg; do
list_kind
;;
p)
ARG_PROM_CONTEXT=$2
if [ ! -z "$ARG_PROM_CONTEXT" ]; then
PROM_CONTEXT=$ARG_PROM_CONTEXT
fi
prometheus_run
;;
:)
+15 -1
View File
@@ -127,7 +127,21 @@ kind v0.14.0 go1.18.2 linux/amd64
## Prometheus with dump
```sh
$ export DUMP_CONTEXT=.dumps/3539792658/prom-dump-3539792658-v1.21.14
$ export PROM_CONTEXT=.dumps/3539792658/prom-dump-3539792658-v1.21.14
$ ./hack/dump-analyzer -p
# Visit localhost:9090
```
To pass dump path directly without setting PROM_CONTEXT,
```sh
$ ./hack/dump-analyzer -p .dumps/3539792658/prom-dump-3539792658-v1.21.14
# Visit localhost:9090
```
You can also run prometheus with multiple dumps,
```sh
PROM_PORT=9091 ./hack/dump-analyzer -p .dumps/3539792658/prom-dump-3539792658-v1.21.14
# Visit localhost:9091
```