Skip to content

Commit de2eee8

Browse files
committed
docs: web server section and table of contents
1 parent 6868ee4 commit de2eee8

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

docs/MONITORING.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
# 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)
29

3-
## Frontend monitoring
10+
11+
## Frontend monitoring <a name="introduction"></a>
412
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).
513

6-
### 1. Getting your serverUrl
14+
### 1. Getting your APM Server URL <a name="server-url"></a>
715
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`:
816

917
![Navigation instructions to APM in Kibana](/docs/public/kibana-screenshot-1.png)
@@ -20,7 +28,7 @@ There are two suggested code blocks for setting up the RUM Agent, find in any of
2028

2129
*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.*
2230

23-
### 2. Using the /public/init-js script
31+
### 2. Using the /public/init-js script <a name="init-js"></a>
2432

2533
The __compas-open-scd__ project features a reference to an "empty" javascript resource at `index.html` (line:42)
2634
```html
@@ -48,7 +56,7 @@ script.onload = function () {
4856
document.querySelector('head').appendChild(script);
4957
```
5058

51-
### 3. Cloning private git repo using Kubernetes initContainers and Kubernetes Secrets
59+
### 3. Cloning private git repo using Kubernetes initContainers and Kubernetes Secrets <a name="init-containers"></a>
5260
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.
5361

5462
Then you must create your Kubernetes Secret:
@@ -103,13 +111,13 @@ kubectl apply -f your-yaml-template.yaml
103111

104112
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/`.
105113

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) <a name="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`.
108116

109-
### 5. References
117+
### 5. References <a name="references"></a>
110118

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)
112120

113-
[Full APM Guide](https://www.elastic.co/guide/en/apm/guide/8.6/apm-quick-start.html)
121+
* [Full APM Guide](https://www.elastic.co/guide/en/apm/guide/8.6/apm-quick-start.html)
114122

115-
[@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

Comments
 (0)