From 668e53897f713ba98f287935cbfe7c6e5fce3119 Mon Sep 17 00:00:00 2001 From: Steve Waterworth Date: Thu, 8 Mar 2018 12:16:15 +0000 Subject: [PATCH] Support for on prem eum --- README.md | 2 ++ web/entrypoint.sh | 12 +++++++++++- web/static/eum-tmpl.html | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d3bb261..5bbc999 100644 --- a/README.md +++ b/README.md @@ -75,3 +75,5 @@ A separate load generation utility is provided in the *load-gen* directory. This ## End User Monitoring To enable End User Monitoring (EUM) see the official [documentation](https://docs.instana.io/products/website_monitoring/) for how to create a configuration. There is no need to inject the javascript fragment into the page, this will be handled automatically. Just make a note of the unique key and set the environment variable INSTANA_EUM_KEY for the *web* image, see *docker-compose.yaml* for an example. + +If you are running the Instana backend on premise, you will also need to set the Reporting URL to your local instance. Set the environment variable INSTANA_EUM_REPORTING_URL as above. See the Instana EUM API [reference](https://docs.instana.io/products/website_monitoring/api/#api-structure) \ No newline at end of file diff --git a/web/entrypoint.sh b/web/entrypoint.sh index de82d19..fb6e791 100755 --- a/web/entrypoint.sh +++ b/web/entrypoint.sh @@ -14,7 +14,17 @@ fi if [ -n "$INSTANA_EUM_KEY" ] then echo "Enabling Instana EUM" - sed -e "/ineum/s/INSTANA_EUM_KEY/$INSTANA_EUM_KEY/" $BASE_DIR/eum-tmpl.html > $BASE_DIR/eum.html + 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 inuem('reportingUrl', '$INSTANA_EUM_REPORTING_URL');" $TMP_FILE > $BASE_DIR/eum.html + else + cp $TMP_FILE $BASE_DIR/eum.html + fi + + rm $TMP_FILE else cp $BASE_DIR/empty.html $BASE_DIR/eum.html fi diff --git a/web/static/eum-tmpl.html b/web/static/eum-tmpl.html index 3630f21..972d83c 100644 --- a/web/static/eum-tmpl.html +++ b/web/static/eum-tmpl.html @@ -5,6 +5,7 @@ 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('page', 'Shop');