From 1b6d8d6c52d80d0b9fdf156bbaf300e92a0c9da5 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 23 Dec 2020 13:18:22 +0100 Subject: [PATCH 1/5] add monitoring and tracing for ocis_traefik --- deployments/examples/ocis_traefik/.env | 5 +++++ deployments/examples/ocis_traefik/docker-compose.yml | 7 +++++-- .../monitoring_tracing/docker-compose-additions.yml | 12 ++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 deployments/examples/ocis_traefik/monitoring_tracing/docker-compose-additions.yml diff --git a/deployments/examples/ocis_traefik/.env b/deployments/examples/ocis_traefik/.env index 8c524e3209..a2169a67e2 100644 --- a/deployments/examples/ocis_traefik/.env +++ b/deployments/examples/ocis_traefik/.env @@ -15,3 +15,8 @@ TRAEFIK_ACME_MAIL= OCIS_DOCKER_TAG= # Domain of oCIS, where you can find the frontend. Defaults to "ocis.owncloud.test" OCIS_DOMAIN= + +# If you want to use debugging and tracing with this stack: +# you need to enable +# please follow docs for this +#COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml diff --git a/deployments/examples/ocis_traefik/docker-compose.yml b/deployments/examples/ocis_traefik/docker-compose.yml index 7afac8155a..0326958f8f 100644 --- a/deployments/examples/ocis_traefik/docker-compose.yml +++ b/deployments/examples/ocis_traefik/docker-compose.yml @@ -5,7 +5,7 @@ services: traefik: image: "traefik:v2.3" networks: - default: + ocis-net: aliases: - ${OCIS_DOMAIN:-ocis.owncloud.test} command: @@ -43,7 +43,7 @@ services: ocis: image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest} networks: - default: + ocis-net: environment: OCIS_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test} OCIS_LOG_LEVEL: ${OCIS_LOG_LEVEL:-error} # make oCIS less verbose @@ -68,3 +68,6 @@ services: volumes: certs: ocis-data: + +networks: + ocis-net: diff --git a/deployments/examples/ocis_traefik/monitoring_tracing/docker-compose-additions.yml b/deployments/examples/ocis_traefik/monitoring_tracing/docker-compose-additions.yml new file mode 100644 index 0000000000..16d1d47df8 --- /dev/null +++ b/deployments/examples/ocis_traefik/monitoring_tracing/docker-compose-additions.yml @@ -0,0 +1,12 @@ +--- +version: "3.7" + +services: + ocis: + environment: + OCIS_TRACING_ENABLED: "true" + OCIS_TRACING_ENDPOINT: jaeger-agent:6831 + +networks: + ocis-net: + external: true From 0bd5327b43d3602b3bc38a36fcbb613d859284ac Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 23 Dec 2020 15:20:20 +0100 Subject: [PATCH 2/5] also add for other examples --- deployments/examples/cs3_users_ocis/.env | 6 ++++++ .../monitoring_tracing/docker-compose-additions.yml | 12 ++++++++++++ deployments/examples/ocis_keycloak/.env | 6 ++++++ .../monitoring_tracing/docker-compose-additions.yml | 12 ++++++++++++ deployments/examples/ocis_traefik/.env | 3 ++- deployments/examples/owncloud10_with_oc_web/.env | 6 ++++++ 6 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 deployments/examples/cs3_users_ocis/monitoring_tracing/docker-compose-additions.yml create mode 100644 deployments/examples/ocis_keycloak/monitoring_tracing/docker-compose-additions.yml diff --git a/deployments/examples/cs3_users_ocis/.env b/deployments/examples/cs3_users_ocis/.env index b3d7130e07..acd941a41b 100644 --- a/deployments/examples/cs3_users_ocis/.env +++ b/deployments/examples/cs3_users_ocis/.env @@ -24,3 +24,9 @@ LDAP_ADMIN_PASSWORD= ### LDAP manager settings ### # Domain of LDAP manager. Defaults to "ldap.owncloud.test" LDAP_MANAGER_DOMAIN= + + +# If you want to use debugging and tracing with this stack: +# you need to enable +# please follow docs for this +#COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml diff --git a/deployments/examples/cs3_users_ocis/monitoring_tracing/docker-compose-additions.yml b/deployments/examples/cs3_users_ocis/monitoring_tracing/docker-compose-additions.yml new file mode 100644 index 0000000000..16d1d47df8 --- /dev/null +++ b/deployments/examples/cs3_users_ocis/monitoring_tracing/docker-compose-additions.yml @@ -0,0 +1,12 @@ +--- +version: "3.7" + +services: + ocis: + environment: + OCIS_TRACING_ENABLED: "true" + OCIS_TRACING_ENDPOINT: jaeger-agent:6831 + +networks: + ocis-net: + external: true diff --git a/deployments/examples/ocis_keycloak/.env b/deployments/examples/ocis_keycloak/.env index 7506aa585c..c7295a244b 100644 --- a/deployments/examples/ocis_keycloak/.env +++ b/deployments/examples/ocis_keycloak/.env @@ -27,3 +27,9 @@ KEYCLOAK_REALM= KEYCLOAK_ADMIN_USER= # Admin user login password. Defaults to "admin" KEYCLOAK_ADMIN_PASSWORD= + + +# If you want to use debugging and tracing with this stack: +# you need to enable +# please follow docs for this +#COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml diff --git a/deployments/examples/ocis_keycloak/monitoring_tracing/docker-compose-additions.yml b/deployments/examples/ocis_keycloak/monitoring_tracing/docker-compose-additions.yml new file mode 100644 index 0000000000..16d1d47df8 --- /dev/null +++ b/deployments/examples/ocis_keycloak/monitoring_tracing/docker-compose-additions.yml @@ -0,0 +1,12 @@ +--- +version: "3.7" + +services: + ocis: + environment: + OCIS_TRACING_ENABLED: "true" + OCIS_TRACING_ENDPOINT: jaeger-agent:6831 + +networks: + ocis-net: + external: true diff --git a/deployments/examples/ocis_traefik/.env b/deployments/examples/ocis_traefik/.env index a2169a67e2..0e96851f70 100644 --- a/deployments/examples/ocis_traefik/.env +++ b/deployments/examples/ocis_traefik/.env @@ -16,7 +16,8 @@ OCIS_DOCKER_TAG= # Domain of oCIS, where you can find the frontend. Defaults to "ocis.owncloud.test" OCIS_DOMAIN= + # If you want to use debugging and tracing with this stack: # you need to enable # please follow docs for this -#COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml +COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml diff --git a/deployments/examples/owncloud10_with_oc_web/.env b/deployments/examples/owncloud10_with_oc_web/.env index 9bd556c73e..fefb0161af 100644 --- a/deployments/examples/owncloud10_with_oc_web/.env +++ b/deployments/examples/owncloud10_with_oc_web/.env @@ -19,3 +19,9 @@ OCIS_DOMAIN= ### oC10 ### # Domain of ownCloud 10, where you can find the frontend. Defaults to "oc10.owncloud.test" #OC10_DOMAIN= + + +# If you want to use debugging and tracing with this stack: +# you need to enable +# please follow docs for this +#COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml From 01ae463c67051a372a63303ad3e84c9afafb19a1 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 30 Dec 2020 10:27:35 +0100 Subject: [PATCH 3/5] disable metrics by default --- deployments/examples/ocis_traefik/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/examples/ocis_traefik/.env b/deployments/examples/ocis_traefik/.env index 0e96851f70..5c55cb2145 100644 --- a/deployments/examples/ocis_traefik/.env +++ b/deployments/examples/ocis_traefik/.env @@ -20,4 +20,4 @@ OCIS_DOMAIN= # If you want to use debugging and tracing with this stack: # you need to enable # please follow docs for this -COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml +#COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml From 48f8bf3ea2c6867c065aeb03fae000ee3c536468 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 30 Dec 2020 13:35:43 +0100 Subject: [PATCH 4/5] fix .env doc --- deployments/examples/cs3_users_ocis/.env | 6 +++--- deployments/examples/ocis_keycloak/.env | 6 +++--- deployments/examples/ocis_traefik/.env | 6 +++--- deployments/examples/owncloud10_with_oc_web/.env | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/deployments/examples/cs3_users_ocis/.env b/deployments/examples/cs3_users_ocis/.env index acd941a41b..b8e592aa89 100644 --- a/deployments/examples/cs3_users_ocis/.env +++ b/deployments/examples/cs3_users_ocis/.env @@ -26,7 +26,7 @@ LDAP_ADMIN_PASSWORD= LDAP_MANAGER_DOMAIN= -# If you want to use debugging and tracing with this stack: -# you need to enable -# please follow docs for this +# If you want to use debugging and tracing with this stack, +# you need uncomment following line. Please see documentation at +# https://owncloud.github.io/ocis/deployment/monitoring-tracing/ #COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml diff --git a/deployments/examples/ocis_keycloak/.env b/deployments/examples/ocis_keycloak/.env index c7295a244b..4c08ef11e3 100644 --- a/deployments/examples/ocis_keycloak/.env +++ b/deployments/examples/ocis_keycloak/.env @@ -29,7 +29,7 @@ KEYCLOAK_ADMIN_USER= KEYCLOAK_ADMIN_PASSWORD= -# If you want to use debugging and tracing with this stack: -# you need to enable -# please follow docs for this +# If you want to use debugging and tracing with this stack, +# you need uncomment following line. Please see documentation at +# https://owncloud.github.io/ocis/deployment/monitoring-tracing/ #COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml diff --git a/deployments/examples/ocis_traefik/.env b/deployments/examples/ocis_traefik/.env index 5c55cb2145..0a774f2917 100644 --- a/deployments/examples/ocis_traefik/.env +++ b/deployments/examples/ocis_traefik/.env @@ -17,7 +17,7 @@ OCIS_DOCKER_TAG= OCIS_DOMAIN= -# If you want to use debugging and tracing with this stack: -# you need to enable -# please follow docs for this +# If you want to use debugging and tracing with this stack, +# you need uncomment following line. Please see documentation at +# https://owncloud.github.io/ocis/deployment/monitoring-tracing/ #COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml diff --git a/deployments/examples/owncloud10_with_oc_web/.env b/deployments/examples/owncloud10_with_oc_web/.env index fefb0161af..424e514af3 100644 --- a/deployments/examples/owncloud10_with_oc_web/.env +++ b/deployments/examples/owncloud10_with_oc_web/.env @@ -21,7 +21,7 @@ OCIS_DOMAIN= #OC10_DOMAIN= -# If you want to use debugging and tracing with this stack: -# you need to enable -# please follow docs for this +# If you want to use debugging and tracing with this stack, +# you need uncomment following line. Please see documentation at +# https://owncloud.github.io/ocis/deployment/monitoring-tracing/ #COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml From 2ddde64205fb92aea78a031e4556fcc466a08b8b Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Wed, 30 Dec 2020 17:13:15 +0100 Subject: [PATCH 5/5] add documentation --- docs/Makefile | 4 - docs/ocis/deployment/monitoring-tracing.md | 40 +++ .../monitoring_tracing_overview.drawio.svg | 280 ++++++++++++++++++ 3 files changed, 320 insertions(+), 4 deletions(-) create mode 100644 docs/ocis/deployment/monitoring-tracing.md create mode 100644 docs/ocis/static/monitoring_tracing_overview.drawio.svg diff --git a/docs/Makefile b/docs/Makefile index d7fb0ed9c8..371cbd9219 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -37,10 +37,6 @@ docs-copy: ## copy docs to hugo git checkout origin/source -f; \ rsync -ax --delete --exclude hugo/ --exclude Makefile --exclude .gitignore --exclude README.md ../. content/; \ -.PHONY: docs-serve -docs-serve: config-docs-generate docs-copy - docker run --rm --network host -v $(shell pwd)/hugo:/src owncloudci/hugo:0 server - .PHONY: docs-serve docs-serve: config-docs-generate docs-copy ## serve docs with hugo @docker run --rm --network host -v $(shell pwd)/hugo:/src owncloudci/hugo:0 server diff --git a/docs/ocis/deployment/monitoring-tracing.md b/docs/ocis/deployment/monitoring-tracing.md new file mode 100644 index 0000000000..0f8a56bf61 --- /dev/null +++ b/docs/ocis/deployment/monitoring-tracing.md @@ -0,0 +1,40 @@ +--- +title: "Monitoring & Tracing" +date: 2020-02-27T20:35:00+01:00 +weight: 10 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/ocis/deployment +geekdocFilePath: monitoring_tracing.md +--- + +{{< toc >}} + +Monitoring and tracing gives developers and admin insights into a complex system, in this case oCIS. + +If you are a developer and want to trace during developing you should have a look at [example server setup]({{< ref "../development/tracing.md" >}}). + +This documentation describes how to set up a long running monitoring & tracing infrastructure for one or multiple oCIS servers or deployments. After reading this guide, you also should know everything needed to integrate oCIS into your existing monitoring and tracing infrastructure. + +# Overview about the proposed solution + +{{< svg src="ocis/static/monitoring_tracing_overview.drawio.svg" >}} + +## Monitoring & tracing clients + +We assume that you already have oCIS deployed on one or multiple servers by using our deployment examples (see rectangle on the left). On these servers our monitoring & tracing clients, namely Telegraf and Jaeger agent, need to be added. + +Telegraf will collect host metrics (CPU, RAM, network, processes, ...) and docker metrics (per container CPU, RAM, network, ...). Telegraf is also configured to scrape metrics from Prometheus metric endpoints which oCIS exposes, this is done by the Prometheus input plugin . The metrics from oCIS and all other metrics gathered will be exposed with the Prometheus output plugin and can therefore be scraped by our monitoring & tracing server. + +Jaeger agent is is being configured as target for traces in oCIS. It then will receive traces from all oCIS extensions, add some process tags to them and forward them to our Jaeger collector on our monitoring & tracing server. + +For more information and how to deploy it, see [monitoring & tracing client](https://github.com/owncloud-devops/monitoring-tracing-client). + +## Monitoring & tracing server + +The monitoring & tracing server is considered as shared infrastructure and is normally used for different services. This means that oCIS is not the only software whose metrics and traces are available on the monitoring server. It is also possible that data of multiple oCIS instances are available on the monitoring server. + +Metrics are scraped, stored and can be queried with Prometheus. For the visualization of these metrics Grafana is used. Because Prometheus is scraping the metrics from the oCIS server (pull model instead of a push model), the Prometheus server must have access to the exposed endpoint of the Telegraf Prometheus output plugin. + +Jaeger collector receives traces sent by the Jaeger agent on the oCIS servers and persists them in ElasticSearch. From there the user can query and visualize the traces in Jaeger query or in Grafana. Because Jaeger agent is actively sending traces to the monitoring & tracing server, the server must be reachable from the oCIS server. + +For more information and how to deploy it, see [monitoring & tracing server](https://github.com/owncloud-devops/monitoring-tracing-server). diff --git a/docs/ocis/static/monitoring_tracing_overview.drawio.svg b/docs/ocis/static/monitoring_tracing_overview.drawio.svg new file mode 100644 index 0000000000..79ea637533 --- /dev/null +++ b/docs/ocis/static/monitoring_tracing_overview.drawio.svg @@ -0,0 +1,280 @@ + + + + + + + + + + + + +
+
+
+ Prometheus +
+
+
+
+ + Prometheus + +
+
+ + + + + + + + +
+
+
+ Jaeger Query +
+
+
+
+ + Jaeger Query + +
+
+ + + + + + +
+
+
+ Jaeger Collector +
+
+
+
+ + Jaeger Collector + +
+
+ + + + +
+
+
+ ElasticSearch +
+
+
+
+ + ElasticSearch + +
+
+ + + + + + + + +
+
+
+ Grafana +
+
+
+
+ + Grafana + +
+
+ + + + + + +
+
+
+ oCIS +
+
+
+
+ + oCIS + +
+
+ + + + +
+
+
+ Telegraf +
+
+
+
+ + Telegraf + +
+
+ + + + +
+
+
+ Prometheus output +
+
+
+
+ + Prometheus output + +
+
+ + + + + + + + +
+
+
+ Prometheus input +
+
+
+
+ + Prometheus input + +
+
+ + + + +
+
+
+ Host & Docker metrics +
+
+
+
+ + Host & Docker metrics + +
+
+ + + + + + +
+
+
+ Jaeger Agent +
+
+
+
+ + Jaeger Agent + +
+
+ + + + + + + + +
+
+
+ server for monitoring & tracing infrastructure +
+
+
+
+ + server for monitoring & tracing infrastru... + +
+
+ + + + +
+
+
+ server(s) for oCIS with monitoring & tracing clients +
+
+
+
+ + server(s) for oCIS with monitoring & tracing c... + +
+
+ + + + +
+
+
+ Visualization and querying of +
+ metrics and traces +
+
+
+
+ + Visualization and querying o... + +
+
+
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file