You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/MONITORING.md
+18-10Lines changed: 18 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,17 @@
1
1
# Monitoring
2
+
## Table of contents
3
+
*[Frontend monitoring](#introduction)
4
+
1.[Getting your APM Server URL](#1-getting-your-apm-server-url)
5
+
2.[Using the /public/init-js script](#2-using-the-publicinit-js-script)
6
+
3.[Cloning private git repo using Kubernetes initContainers and Kubernetes Secrets](#3-cloning-private-git-repo-using-kubernetes-initcontainers-and-kubernetes-secrets)
7
+
4.[Web server configuration (optional)](#4-web-server-configuration-optional)
8
+
5.[References](#5-references)
2
9
3
-
## Frontend monitoring
10
+
11
+
## Frontend monitoring <aname="introduction"></a>
4
12
This section suggests an approach for using Elastic's Real User Monitoring (RUM) in order to capture user interactions with our client-side application CoMPAS-OpenSCD. The following instructions assume you/your organization already count on a hosted Elasticsearch Service deployment or an Elastic Cloud organization account with Kibana as the frontend of your monitoring stack and a URL to access it. Also it is assumed that you deploy `compas-open-scd` by using Kubernetes (and [the compas-open-scd docker public docker image](https://hub.docker.com/r/lfenergy/compas-open-scd) or your own generated image).
5
13
6
-
### 1. Getting your serverUrl
14
+
### 1. Getting your APM Server URL <aname="server-url"></a>
7
15
Navigate to your Kibana URL and select the space that you would like to associate with your frontend app (default if you don't have several spaces in Kibana). Then open the drawer menu and navigate to `APM`:
8
16
9
17

@@ -20,7 +28,7 @@ There are two suggested code blocks for setting up the RUM Agent, find in any of
20
28
21
29
*Note: You have two options for getting your init script, you either install the `@elastic/apm-rum` dependency in your project or you set up the agent with `<script>` tags. In this document we will describe an approach for the latter.*
22
30
23
-
### 2. Using the /public/init-js script
31
+
### 2. Using the /public/init-js script <aname="init-js"></a>
24
32
25
33
The __compas-open-scd__ project features a reference to an "empty" javascript resource at `index.html` (line:42)
### 3. Cloning private git repo using Kubernetes initContainers and Kubernetes Secrets
59
+
### 3. Cloning private git repo using Kubernetes initContainers and Kubernetes Secrets <aname="init-containers"></a>
52
60
Start by generating a personal acccess token in Github and make sure you authorize your token to access your private repo (configure SSO if needed), your token must have checked the write:packages scope checkbox.
Your pod should be up now with an initContainer that clones your private repo and copies the contents of `/path-to-init-js/` to compas-open-scd's `/app/public/init-js/`.
105
113
106
-
### 4. Web server configuration
107
-
// TODO: Asking Pascal to help me describe the problem with outgoing POST requests from Elastic RUM Agent in compas-open-scd and how to approach the solution for it.
114
+
### 4. Web server configuration (optional) <aname="web-server"></a>
115
+
If you're using a web server like nginx or apache and the APM Server runs in an origin different than your server's origin, make sure to [configure CORS](https://www.elastic.co/guide/en/apm/agent/rum-js/master/configuring-cors.html) or setup a directive that allows for POST, OPTIONS http requests to your `serverUrl`.
108
116
109
-
### 5. References
117
+
### 5. References <aname="references"></a>
110
118
111
-
[Full documentation about APM Real User Monitoring JavaScript Agent](https://www.elastic.co/guide/en/apm/agent/rum-js/5.x/intro.html)
119
+
*[Full documentation about APM Real User Monitoring JavaScript Agent](https://www.elastic.co/guide/en/apm/agent/rum-js/5.x/intro.html)
[@stefvnf's medium blog post about cloning git repos using Kubernetes initContainers and Secrets](https://stefvnf.medium.com/cloning-git-repos-using-kubernetes-initcontainers-and-secrets-8609e3b2d238)
123
+
*[@stefvnf's medium blog post about cloning git repos using Kubernetes initContainers and Secrets](https://stefvnf.medium.com/cloning-git-repos-using-kubernetes-initcontainers-and-secrets-8609e3b2d238)
0 commit comments