eum updated for 151

This commit is contained in:
Steve Waterworth
2019-04-09 12:41:31 +01:00
parent 7cc9a4bb25
commit 2003a55f4d
3 changed files with 12 additions and 15 deletions

View File

@@ -145,7 +145,9 @@ services:
condition: on-failure
# Uncomment to enable Instana EUM
# environment:
# INSTANA_EUM_KEY: <your eum key here>
# INSTANA_EUM_KEY: <your eum key>
# INSTANA_EUM_REPORTING_URL: https://eum-us-west-2.instana.io
# INSTANA_EUM_REPORTING_URL: https://eum-eu-west-1.instana.io
networks:
robot-shop:

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# set -x
#set -x
# echo "arg 1 $1"
@@ -11,21 +11,15 @@ then
exec "$@"
fi
if [ -n "$INSTANA_EUM_KEY" ]
if [ -n "$INSTANA_EUM_KEY" -a -n "$INSTANA_EUM_REPORTING_URL" ]
then
echo "Enabling Instana EUM"
TMP_FILE=$(mktemp)
sed -e "/ineum/s/INSTANA_EUM_KEY/$INSTANA_EUM_KEY/" $BASE_DIR/eum-tmpl.html > $TMP_FILE
if [ -n "$INSTANA_EUM_REPORTING_URL" ]
then
echo "Setting reporting url $INSTANA_EUM_REPORTING_URL"
sed -e "/<\/script>/ i ineum('reportingUrl', '$INSTANA_EUM_REPORTING_URL');" $TMP_FILE > $BASE_DIR/eum.html
else
cp $TMP_FILE $BASE_DIR/eum.html
fi
rm $TMP_FILE
# use | instead of / as command delimiter to avoid eacaping the url
sed -i "s|INSTANA_EUM_KEY|$INSTANA_EUM_KEY|" $BASE_DIR/eum-tmpl.html
sed -i "s|INSTANA_EUM_REPORTING_URL|$INSTANA_EUM_REPORTING_URL|" $BASE_DIR/eum-tmpl.html
cp $BASE_DIR/eum-tmpl.html $BASE_DIR/eum.html
else
echo "EUM not enabled"
cp $BASE_DIR/empty.html $BASE_DIR/eum.html
fi

View File

@@ -4,7 +4,8 @@
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//eum.instana.io/eum.min.js','ineum');
ineum('apiKey', 'INSTANA_EUM_KEY');
ineum('key', 'INSTANA_EUM_KEY');
ineum('reportingUrl', 'INSTANA_EUM_REPORTING_URL');
ineum('page', 'Shop');
</script>
<!-- EUM include end -->