1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-06-15 00:15:15 +02:00

update tracing, fixed docker-compose and removed vendor dir

This commit is contained in:
Lee Brown
2019-05-23 19:40:29 -05:00
parent c77dd8f5f3
commit c19f46e07f
264 changed files with 391 additions and 45102 deletions

View File

@ -2,8 +2,8 @@ FROM datadog/agent:latest
LABEL maintainer="lee@geeksinthewoods.com"
#COPY target/go_expvar.conf.yaml /etc/datadog-agent/conf.d/go_expvar.d/conf.yaml
COPY target/custom-init.sh /custom-init.sh
#COPY go_expvar.conf.yaml /etc/datadog-agent/conf.d/go_expvar.d/conf.yaml
COPY custom-init.sh /custom-init.sh
ARG service
ENV SERVICE_NAME $service

View File

@ -2,13 +2,57 @@
configFile="/etc/datadog-agent/conf.d/go_expvar.d/conf.yaml"
echo -e "init_config:\n\ninstances:\n - expvar_url: http://localhost:80/debug/vars" > $configFile
echo -e "init_config:\n\ninstances:\n" > $configFile
if [[ "${DD_TAGS}" != "" ]]; then
echo " tags:" >> $configFile
for t in ${DD_TAGS}; do
echo " - \"${t}\"" >> $configFile
done
if [[ "${DD_EXPVAR}" != "" ]]; then
while IFS='|' read -ra HOSTS; do
for h in "${HOSTS[@]}"; do
if [[ "${h}" == "" ]]; then
continue
fi
url=""
for p in $h; do
k=`echo $p | awk -F '=' '{print $1}'`
v=`echo $p | awk -F '=' '{print $2}'`
if [[ "${k}" == "url" ]]; then
url=$v
break
fi
done
if [[ "${url}" == "" ]]; then
echo "No url param found in '${h}'"
continue
fi
echo -e " - expvar_url: ${url}" >> $configFile
if [[ "${DD_TAGS}" != "" ]]; then
echo " tags:" >> $configFile
for t in ${DD_TAGS}; do
echo " - ${t}" >> $configFile
done
fi
for p in $h; do
k=`echo $p | awk -F '=' '{print $1}'`
v=`echo $p | awk -F '=' '{print $2}'`
if [[ "${k}" == "url" ]]; then
continue
fi
echo " - ${k}:${v}" >> $configFile
done
done
done <<< "$DD_EXPVAR"
else :
echo -e " - expvar_url: http://localhost:80/debug/vars" >> $configFile
if [[ "${DD_TAGS}" != "" ]]; then
echo " tags:" >> $configFile
for t in ${DD_TAGS}; do
echo " - ${t}" >> $configFile
done
fi
fi
cat $configFile