From 76c8d4e430ef84cd87d6642df553d191d2125d66 Mon Sep 17 00:00:00 2001
From: hnouts <hnouts@grandlyon.com>
Date: Wed, 2 Feb 2022 17:40:09 +0100
Subject: [PATCH] fix typos, added monitoring query build

---
 docs/easycozy/commands.md     |  7 +++++++
 docs/easycozy/config.md       | 13 +++++--------
 docs/easycozy/known_errors.md |  4 ++--
 docs/easycozy/scripts.md      |  2 +-
 docs/proxy/monitoring.md      | 15 +++++++++++++--
 5 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/docs/easycozy/commands.md b/docs/easycozy/commands.md
index ac3da77..5988bdc 100644
--- a/docs/easycozy/commands.md
+++ b/docs/easycozy/commands.md
@@ -51,6 +51,13 @@ $ cd /root/easy-cozy
 $ docker-compose exec cozy ./cozy instances debug --domain "[name].cozy.self-data.alpha.grandlyon.com" true
 ```
 
+### List all instances
+
+```bash
+$ cd /root/easy-cozy
+# cozy-stack instances ls
+$ docker-compose exec cozy ./cozy instances ls
+```
 
 ## Stack
 
diff --git a/docs/easycozy/config.md b/docs/easycozy/config.md
index 0a525ca..8f2bf2e 100644
--- a/docs/easycozy/config.md
+++ b/docs/easycozy/config.md
@@ -4,13 +4,10 @@ This section includes all configurations available for the stack.
 
 ## Configuration File
 
-The configuration file of the stack is located at `.easy-cozy/cozystack/cozy.yml`. It can be edit in order to changes various parameters, smtp, logs ...
-
+The stack's configuration file is located at `.easy-cozy/cozystack/cozy.yml`. It can be edited in order to changes various parameters, smtp, logs ...
 ## SMTP
 
-### Install a specific version of an app
-
-Modif the `cozy.yml` responsible for the configuration :
+Modify the `cozy.yml` responsible for the configuration :
 
 ```yml
 mail:
@@ -32,13 +29,13 @@ mail:
   skip_certificate_validation: false
 ```
 
-According to cozy-stack issue: https://github.com/cozy/cozy-stack/issues/2009 you might need to change above configuration with :
-
+!!! warning "known issue"
+    A known cozy-stack issue: [here](https://github.com/cozy/cozy-stack/issues/2009) causes you to have to above configuration with:
 ```yml
 mail:
   # mail smtp port - flags: --mail-port
   port: 587
-  # disable mail tls - flags: --mail-disable-tls
+  # disable mail tls - flags: --mail-disable-tls  
   disable_tls: true
 ```
 
diff --git a/docs/easycozy/known_errors.md b/docs/easycozy/known_errors.md
index bdf141b..cf56c48 100644
--- a/docs/easycozy/known_errors.md
+++ b/docs/easycozy/known_errors.md
@@ -1,10 +1,10 @@
 # Oops...
 
-Sometime the stack is stuck when we reset several instances due to rabbit mq process. The following screen is then obtain when trying to access to an instance:
+Sometime the stack get stucks when we reset several instances, overflowing our message broker rabbitmq. The following screen is then obtained when trying to access an instance:
 ![oops_error](/img/known_errors/oops_error.png)
 
 On the server, we can see that the server is underwater by using "top" command:
 ![oops_error_1](/img/known_errors/oops_error_1.png)
 
-To fix the issue you can just restart the service on the server with "docker-compose down / docker-compose up -d" in the easy-cozy folder:
+To fix this issue, just restart the service on the server with "docker-compose down / docker-compose up -d" in the easy-cozy folder:
 ![oops_error_2](/img/known_errors/oops_error_2.png)
\ No newline at end of file
diff --git a/docs/easycozy/scripts.md b/docs/easycozy/scripts.md
index 91766c9..4de6b61 100644
--- a/docs/easycozy/scripts.md
+++ b/docs/easycozy/scripts.md
@@ -5,7 +5,7 @@ Easy cozy project comes with 2 main scripts:
 - create-instance.sh: used to create an instance for a user
 - remove-instance.sh: used to remove an instance for a specific user
 
-In addition of these scripts we have added custom scripts for some specific needs. All these scripts are available in the "admin_scripts" folder
+In addition of these scripts we have added custom scripts for some specific needs. All these scripts are available in the "ecolyo-infa-scripts/admin_scripts" folder
 
 ## Scripts for instances
 
diff --git a/docs/proxy/monitoring.md b/docs/proxy/monitoring.md
index da9a6c2..294ce8c 100644
--- a/docs/proxy/monitoring.md
+++ b/docs/proxy/monitoring.md
@@ -3,8 +3,19 @@ All logs printed by the Proxy are read and translated into statistics on a grafa
 !!! info "Grafana"
     [scaleway monitoring](https://grafana.self-data.alpha.grandlyon.com/)
 
-    [production](https://oauth-logs.cozycloud.cc/d/xSRhz8fMk/cozy-oauth-proxy?orgId=1&refresh=5s)
+    [production address](https://oauth-logs.cozycloud.cc/d/xSRhz8fMk/cozy-oauth-proxy?orgId=1&refresh=5s)
  
-Thanks to this monitoring system, the team is able to understand when something goes wrong with a konnector if the konnector or the proxy are to blame or if an issue was coming from Enedis or Grdf.
+This monitoring system allow the team to parse more easily the cozy-stack logs when something goes wrong. For instance, test konnector or check from the proxy if an issue was coming from Enedis or Grdf.
 
 Learn more about how it works [here](https://forge.grandlyon.com/web-et-numerique/llle_project/logs-monitoring).
+
+!!! warning "High volume"
+    The service parses a very high amount of logs, most of all when debugging an instance. To limit our disk usage we tend to stop the service when not needed.
+    Just type docker-compose down to stop it in monitoring/logs-monitoring. The docker volume will be persisted.
+
+To easily plug loki on a specific instance:
+
+- Click on configuration and data sources
+- Add data sources
+- Find Loki and type the loki url http://loki:3100
+- In the query builder select the container "easy-cozy" then add |= "domain=[specific-instance]"
\ No newline at end of file
-- 
GitLab