Skip to content

Commit

Permalink
Merge pull request #138 from FalkorDB/136-add-separate-env-var-to-ena…
Browse files Browse the repository at this point in the history
…ble-or-disable-debugging-for-redis-exporter

Added DEBUG_REDIS_EXPORTER variable
  • Loading branch information
dudizimber authored Sep 25, 2024
2 parents f23f499 + 165f0f8 commit 4f00afb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
11 changes: 10 additions & 1 deletion falkordb-cluster/cluster-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ handle_sigterm() {
if [[ ! -z $falkordb_pid ]]; then
kill -TERM $falkordb_pid
fi

if [[ $RUN_METRICS -eq 1 && ! -z $redis_exporter_pid ]]; then
kill -TERM $redis_exporter_pid
fi

if [[ $RUN_HEALTH_CHECK -eq 1 && ! -z $healthcheck_pid ]]; then
kill -TERM $healthcheck_pid
fi
}

trap handle_sigterm SIGTERM
Expand Down Expand Up @@ -293,7 +301,8 @@ fi
if [[ $RUN_METRICS -eq 1 ]]; then
echo "Starting Metrics"
exporter_url=$(if [[ $TLS == "true" ]]; then echo "rediss://$NODE_HOST:$NODE_PORT"; else echo "redis://localhost:$NODE_PORT"; fi)
redis_exporter -skip-tls-verification -redis.password $ADMIN_PASSWORD -redis.addr $exporter_url -log-format json -is-cluster | awk '{ print "**EXPORTER**: " $0 }' >>$FALKORDB_LOG_FILE_PATH &
redis_exporter -skip-tls-verification -redis.password $ADMIN_PASSWORD -redis.addr $exporter_url -log-format json -is-cluster -tls-server-min-version TLS1.3 >>$FALKORDB_LOG_FILE_PATH &
redis_exporter_pid=$!
fi

while true; do
Expand Down
1 change: 0 additions & 1 deletion falkordb-node/node-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,6 @@ fi

if [[ $RUN_METRICS -eq 1 ]]; then
echo "Starting Metrics"
export REDIS_EXPORTER_DEBUG=$(if [[ $DEBUG -eq 1 ]]; then echo "true"; else echo "false"; fi)
exporter_url=$(if [[ $TLS == "true" ]]; then echo "rediss://$NODE_HOST:$NODE_PORT"; else echo "redis://localhost:$NODE_PORT"; fi)
redis_exporter -skip-tls-verification -redis.password $ADMIN_PASSWORD -redis.addr $exporter_url -log-format json -tls-server-min-version TLS1.3 &
redis_exporter_pid=$!
Expand Down
6 changes: 6 additions & 0 deletions omnistrate.pro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,7 @@ services:
- RUN_HEALTH_CHECK_SENTINEL=1
- BROWSER=0
- DEBUG=0
- REDIS_EXPORTER_DEBUG=false
- SENTINEL_HOST=$sentinel-sz.sys.network.externalClusterEndpoint
- SENTINEL_PORT=26379
- MASTER_NAME=master
Expand Down Expand Up @@ -1193,6 +1194,7 @@ services:
- RUN_HEALTH_CHECK=1
- RUN_HEALTH_CHECK_SENTINEL=1
- DEBUG=0
- REDIS_EXPORTER_DEBUG=false
- SENTINEL_PORT=26379
- TLS=$var.enableTLS
- DATA_DIR=/data
Expand Down Expand Up @@ -1626,6 +1628,7 @@ services:
- RUN_HEALTH_CHECK_SENTINEL=1
- BROWSER=0
- DEBUG=0
- REDIS_EXPORTER_DEBUG=false
- IS_MULTI_ZONE=1
- SENTINEL_HOST=$sentinel-mz.sys.network.externalClusterEndpoint
- SENTINEL_PORT=26379
Expand Down Expand Up @@ -1719,6 +1722,7 @@ services:
- RUN_HEALTH_CHECK=1
- RUN_HEALTH_CHECK_SENTINEL=1
- DEBUG=0
- REDIS_EXPORTER_DEBUG=false
- SENTINEL_PORT=26379
- TLS=$var.enableTLS
- DATA_DIR=/data
Expand Down Expand Up @@ -2053,6 +2057,7 @@ services:
- CLUSTER_REPLICAS=1
- NODE_PORT=6379
- DEBUG=0
- REDIS_EXPORTER_DEBUG=false
secrets:
- source: adminpasspath
target: /run/secrets/adminpassword
Expand Down Expand Up @@ -2353,6 +2358,7 @@ services:
- CLUSTER_REPLICAS=1
- NODE_PORT=6379
- DEBUG=0
- REDIS_EXPORTER_DEBUG=false
secrets:
- source: adminpasspath
target: /run/secrets/adminpassword
Expand Down

0 comments on commit 4f00afb

Please sign in to comment.