mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-09 23:02:13 -05:00
AUTO-413: Use an internal app for statsd preview
- We are running statsd exporter as an app with a public route for Prometheus to scrape - This updates preview to send statsd metrics over the CF internal networking to the statsd exporter - Removes the sidecar statsd exporters too
This commit is contained in:
@@ -69,20 +69,10 @@ function start_aws_logs_agent {
|
||||
echo "AWS logs agent pid: ${AWSLOGS_AGENT_PID}"
|
||||
}
|
||||
|
||||
function start_statsd_exporter {
|
||||
echo "Starting statsd exporter..."
|
||||
exec ./scripts/statsd_exporter --web.listen-address=":${PORT}" --statsd.listen-udp=":8125" --statsd.mapping-config=statsd_mapping.yml &
|
||||
STATSD_EXPORTER_PID=$!
|
||||
echo "Statsd exporter pid: ${STATSD_EXPORTER_PID}"
|
||||
}
|
||||
|
||||
function run {
|
||||
while true; do
|
||||
kill -0 ${APP_PID} 2&>/dev/null || break
|
||||
kill -0 ${AWSLOGS_AGENT_PID} 2&>/dev/null || start_aws_logs_agent
|
||||
if [ "${STATSD_HOST}" == "localhost" ]; then
|
||||
kill -0 ${STATSD_EXPORTER_PID} 2&>/dev/null || start_statsd_exporter
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
@@ -94,9 +84,6 @@ check_params
|
||||
trap "on_exit" EXIT
|
||||
|
||||
configure_aws_logs
|
||||
if [ "${STATSD_HOST}" == "localhost" ]; then
|
||||
start_statsd_exporter
|
||||
fi
|
||||
|
||||
# The application has to start first!
|
||||
start_application "$@"
|
||||
|
||||
@@ -104,13 +104,6 @@ function start_logs_tail {
|
||||
echo "tail pid: ${LOGS_TAIL_PID}"
|
||||
}
|
||||
|
||||
function start_statsd_exporter {
|
||||
echo "Starting statsd exporter..."
|
||||
exec ./scripts/statsd_exporter --web.listen-address=":${PORT}" --statsd.listen-udp=":8125" --statsd.mapping-config=statsd_mapping.yml &
|
||||
STATSD_EXPORTER_PID=$!
|
||||
echo "Statsd exporter pid: ${STATSD_EXPORTER_PID}"
|
||||
}
|
||||
|
||||
function ensure_celery_is_running {
|
||||
if [ "${APP_PIDS}" = "" ]; then
|
||||
echo "There are no celery processes running, this container is bad"
|
||||
@@ -126,7 +119,6 @@ function ensure_celery_is_running {
|
||||
echo "Killing awslogs_agent and tail"
|
||||
kill -9 ${AWSLOGS_AGENT_PID}
|
||||
kill -9 ${LOGS_TAIL_PID}
|
||||
kill -9 ${STATSD_EXPORTER_PID}
|
||||
|
||||
exit 1
|
||||
fi
|
||||
@@ -143,9 +135,6 @@ function run {
|
||||
done
|
||||
kill -0 ${AWSLOGS_AGENT_PID} 2&>/dev/null || start_aws_logs_agent
|
||||
kill -0 ${LOGS_TAIL_PID} 2&>/dev/null || start_logs_tail
|
||||
if [ "${STATSD_HOST}" == "localhost" ]; then
|
||||
kill -0 ${STATSD_EXPORTER_PID} 2&>/dev/null || start_statsd_exporter
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
@@ -157,9 +146,6 @@ check_params
|
||||
trap "on_exit" EXIT
|
||||
|
||||
configure_aws_logs
|
||||
if [ "${STATSD_HOST}" == "localhost" ]; then
|
||||
start_statsd_exporter
|
||||
fi
|
||||
|
||||
# The application has to start first!
|
||||
start_application "$@"
|
||||
|
||||
Reference in New Issue
Block a user