mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-01-02 13:23:13 +00:00
observability: unify compose and k8s deploy script
This commit is contained in:
parent
698efc6292
commit
9d2238b7a7
@ -65,7 +65,7 @@ pub const LONG_RUN_DURATION: Duration = Duration::from_secs(300);
|
||||
- Use block statistics (`block_feed.stats().total_transactions()`) to verify inclusion
|
||||
|
||||
**Collect metrics**
|
||||
- Set up Prometheus/Grafana via `scripts/observability/compose/up.sh` for visualizing node behavior
|
||||
- Set up Prometheus/Grafana via `scripts/observability/deploy.sh -t compose -a up` for visualizing node behavior
|
||||
- Use metrics to identify bottlenecks before adding more load
|
||||
- Monitor mempool size, block size, and consensus timing
|
||||
|
||||
|
||||
76
scripts/observability/deploy.sh
Executable file
76
scripts/observability/deploy.sh
Executable file
@ -0,0 +1,76 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
# shellcheck disable=SC1091
|
||||
. "${SCRIPT_DIR}/../lib/common.sh"
|
||||
|
||||
common::ensure_bash "$@"
|
||||
ROOT="$(common::repo_root)"
|
||||
|
||||
usage() {
|
||||
cat <<'USAGE'
|
||||
Usage:
|
||||
scripts/observability/deploy.sh --target compose --action up|down|logs|env
|
||||
scripts/observability/deploy.sh --target k8s --action install|uninstall|dashboards|env
|
||||
|
||||
Short flags:
|
||||
-t, --target compose|k8s
|
||||
-a, --action (see above)
|
||||
|
||||
Examples:
|
||||
scripts/observability/deploy.sh -t compose -a up
|
||||
eval "$(scripts/observability/deploy.sh -t compose -a env)"
|
||||
|
||||
scripts/observability/deploy.sh -t k8s -a install
|
||||
scripts/observability/deploy.sh -t k8s -a dashboards
|
||||
scripts/observability/deploy.sh -t k8s -a env
|
||||
USAGE
|
||||
}
|
||||
|
||||
die_usage() {
|
||||
echo "ERROR: $1" >&2
|
||||
echo >&2
|
||||
usage >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
target=""
|
||||
action=""
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-t|--target)
|
||||
target="${2:-}"; shift 2 ;;
|
||||
-a|--action)
|
||||
action="${2:-}"; shift 2 ;;
|
||||
-h|--help|help)
|
||||
usage; exit 0 ;;
|
||||
*)
|
||||
die_usage "Unknown argument: $1" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
[ -n "${target}" ] || die_usage "Missing --target"
|
||||
[ -n "${action}" ] || die_usage "Missing --action"
|
||||
|
||||
case "${target}" in
|
||||
compose)
|
||||
case "${action}" in
|
||||
up|down|logs|env) ;;
|
||||
*) die_usage "Invalid compose action: ${action}" ;;
|
||||
esac
|
||||
;;
|
||||
k8s)
|
||||
case "${action}" in
|
||||
install|uninstall|dashboards|env) ;;
|
||||
*) die_usage "Invalid k8s action: ${action}" ;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
die_usage "Invalid --target: ${target} (expected compose|k8s)"
|
||||
;;
|
||||
esac
|
||||
|
||||
exec "${ROOT}/scripts/setup/setup-observability.sh" "${target}" "${action}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user