dev_1.0.0_sundp 完成Metric模块及模块e2e测试 (#18)
Co-authored-by: sundapeng.sdp <sundapeng@hashdata.cn> Reviewed-on: #18 Reviewed-by: xuxt <xuxt@zgclab.edu.cn> Reviewed-by: yuyr <yuyr@zgclab.edu.cn> Reviewed-by: huhy <husteryezi@163.com>
This commit was merged in pull request #18.
This commit is contained in:
26
src/metric/prometheus/build/start-prometheus-supervised.sh
Executable file
26
src/metric/prometheus/build/start-prometheus-supervised.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
echo "[INFO] Starting Prometheus under supervisor..."
|
||||
|
||||
PROMETHEUS_BASE_PATH=${PROMETHEUS_BASE_PATH:-/private/argus/metric/prometheus}
|
||||
DOMAIN=prom.metric.argus.com
|
||||
|
||||
echo "[INFO] Prometheus base path: ${PROMETHEUS_BASE_PATH}"
|
||||
|
||||
# 生成配置文件
|
||||
echo "[INFO] Generating prometheus.yml with base path: ${PROMETHEUS_BASE_PATH}"
|
||||
sed "s|\${PROMETHEUS_BASE_PATH}|${PROMETHEUS_BASE_PATH}|g" \
|
||||
/etc/prometheus/prometheus.yml > ${PROMETHEUS_BASE_PATH}/prometheus.yml
|
||||
|
||||
# 记录容器 IP
|
||||
IP=$(ifconfig eth0 | awk '/inet /{print $2}')
|
||||
echo "current IP: ${IP}"
|
||||
echo "${IP}" > /private/argus/etc/${DOMAIN}
|
||||
|
||||
exec /bin/prometheus \
|
||||
--config.file=${PROMETHEUS_BASE_PATH}/prometheus.yml \
|
||||
--storage.tsdb.path=/prometheus \
|
||||
--web.enable-lifecycle \
|
||||
--web.console.libraries=/usr/share/prometheus/console_libraries \
|
||||
--web.console.templates=/usr/share/prometheus/consoles
|
||||
Reference in New Issue
Block a user