feat(logging): Added Elastic APM RUM logging. (TV-316)

Squashed commit of the following:

commit 3c4abbe69605caff2a39efafd90550d93e9e1447
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Mon Oct 4 15:56:41 2021 +0200

    Updated npm scripts and built/serve shell

commit 00525a666fb6b3146ea5f85c7c3ad741378401de
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Mon Oct 4 13:59:12 2021 +0200

    Updated nginx-conf

commit a9945c14cc93eebf8812c075fe8ca67e39ab8ae8
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Mon Oct 4 12:59:49 2021 +0200

    Added elastics serverUrl to environment files and fixed nginx-conf

commit 38872cea957ce54c5cb496890e4be88fb019be58
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Mon Oct 4 12:49:41 2021 +0200

    Added Elastic APM with error handling

commit d3db5e8703e3b0a1d0d0b24230dc52a64bee252c
Merge: a3bc70e9 d139f750
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Mon Oct 4 12:22:16 2021 +0200

    Merge branch 'develop' into feature/TV-316-RUM

commit a3bc70e9420dc5d309325cfcf1221c6760d18c38
Merge: 3f98a66b c2a02dba
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Mon Oct 4 09:07:11 2021 +0200

    Merge branch 'develop' into feature/TV-316-RUM

commit 3f98a66bfda3af315c5417e2d2902ab80877b98b
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Fri Oct 1 16:05:43 2021 +0200

    Added @elastic/apm-rum-angular to log errors and api-requests
This commit is contained in:
Erik Tiekstra
2021-10-05 07:22:10 +02:00
parent 81ea5611f2
commit 07ec3c4aeb
34 changed files with 343 additions and 240 deletions

View File

@@ -33,21 +33,22 @@ version=${version:-$config}
# ----------------------------------
# UPDATING VERSION
# ----------------------------------
echo -e "${CYAN}Setting version to ${version} inside environments.${config}.ts${NOCOLOR}"
sed "s/version:.*',/version: '${version}',/" apps/mina-sidor-fa/src/environments/environment.$config.ts > temp.txt && mv temp.txt apps/mina-sidor-fa/src/environments/environment.$config.ts
echo -e "${CYAN}Setting version to ${version} inside the environments file${NOCOLOR}"
if [ $config = "api" ]; then
sed "s/version:.*',/version: '${version}',/" apps/mina-sidor-fa/src/environments/environment.ts > temp.txt && mv temp.txt apps/mina-sidor-fa/src/environments/environment.ts
else
sed "s/version:.*',/version: '${version}',/" apps/mina-sidor-fa/src/environments/environment.$config.ts > temp.txt && mv temp.txt apps/mina-sidor-fa/src/environments/environment.$config.ts
fi
echo -e "${GREEN}Version set to ${version}${NOCOLOR}"
# ----------------------------------
# BUILD APPLICATION
# ----------------------------------
if [ $config = "prod" ]; then
echo -e "${CYAN}Running npm run build -- --prod${NOCOLOR}"
npm run build -- --prod
echo -e "${GREEN}Application built ${VERSION}${NOCOLOR}"
exit
echo -e "${CYAN}Running npm run ng build mina-sidor-fa -- --configuration ${config}${NOCOLOR}"
if [ $config = "api" ]; then
npm run ng build mina-sidor-fa
else
echo -e "${CYAN}Running npm run build:${CONFIG}${NOCOLOR}"
npm run build:$config
echo -e "${GREEN}Application built ${VERSION}${NOCOLOR}"
exit
npm run ng build mina-sidor-fa -- --configuration $config
fi
echo -e "${GREEN}Application built: ${version}${NOCOLOR}"
exit

View File

@@ -27,15 +27,15 @@ while [ $# -gt 0 ]; do
shift
done
config=${config:-prod}
config=${config:-api}
version=${version:-$config}
# ----------------------------------
# UPDATING VERSION
# ----------------------------------
echo -e "${CYAN}Setting version to ${version} inside environments.${config}.ts${NOCOLOR}"
if [ $config = "local" ]; then
echo -e "${CYAN}Setting version to ${version} inside the environments file${NOCOLOR}"
if [ $config = "api" ]; then
sed "s/version:.*',/version: '${version}',/" apps/mina-sidor-fa/src/environments/environment.ts > temp.txt && mv temp.txt apps/mina-sidor-fa/src/environments/environment.ts
else
sed "s/version:.*',/version: '${version}',/" apps/mina-sidor-fa/src/environments/environment.$config.ts > temp.txt && mv temp.txt apps/mina-sidor-fa/src/environments/environment.$config.ts
@@ -47,24 +47,11 @@ echo -e "${GREEN}Version set to ${version}${NOCOLOR}"
# ----------------------------------
if [ $config = "prod" ]; then
echo -e "${CYAN}Running npm run start -- --configuration production${NOCOLOR}"
npm run start -- --configuration production
echo -e "${GREEN}Application started${NOCOLOR}"
exit
elif [ $config = 'local' ]; then
echo -e "${CYAN}Running npm run start${NOCOLOR}"
npm run start
echo -e "${GREEN}Application started${NOCOLOR}"
exit
elif [ $config = 'acc' ]; then
echo -e "${CYAN}Running npm run start -- --configuration acc${NOCOLOR}"
npm run start -- --configuration acc
echo -e "${GREEN}Application started${NOCOLOR}"
exit
echo -e "${CYAN}Running npm run ng serve -- --configuration $config${NOCOLOR}"
if [ $config = "api" ]; then
npm run ng serve mina-sidor-fa
else
echo -e "${CYAN}Running npm run start:${CONFIG}${NOCOLOR}"
npm run start:$config
echo -e "${GREEN}Application started${NOCOLOR}"
exit
npm run ng serve mina-sidor-fa -- --configuration $config
fi
echo -e "${GREEN}Application started${NOCOLOR}"
exit