From b18908f85d8c9a697580e16e90bc12fffa22fb5c Mon Sep 17 00:00:00 2001 From: worktheclock <85885287+worktheclock@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:33:02 +0200 Subject: [PATCH] Prometheus language edit --- .../operate/secure-and-monitor/prometheus.mdx | 118 +++++++++--------- 1 file changed, 62 insertions(+), 56 deletions(-) diff --git a/astro/src/content/docs/operate/secure-and-monitor/prometheus.mdx b/astro/src/content/docs/operate/secure-and-monitor/prometheus.mdx index f7bc7c9096..d6bf845d67 100644 --- a/astro/src/content/docs/operate/secure-and-monitor/prometheus.mdx +++ b/astro/src/content/docs/operate/secure-and-monitor/prometheus.mdx @@ -1,6 +1,6 @@ --- -title: Monitor with Prometheus and Grafana -description: Learn how to monitor FusionAuth with Prometheus, Grafana, and Ntfy. +title: Monitor With Prometheus And Grafana +description: Learn how to monitor FusionAuth with Prometheus, Grafana, and ntfy. navcategory: admin section: operate subcategory: secure and monitor @@ -17,11 +17,11 @@ import Diagram5 from 'src/components/docs/operate/secure-and-monitor/prometheusD ## Introduction -This guide explains how to monitor FusionAuth events and metrics with the open-source tools [Prometheus](https://prometheus.io/docs/introduction/overview) and [Grafana](https://grafana.com/grafana), and send you alerts when problems occur. +This guide explains how to monitor FusionAuth events and metrics with the open-source tools [Prometheus](https://prometheus.io/docs/introduction/overview) and [Grafana](https://grafana.com/grafana), and receive alerts when problems occur. -Please read the [FusionAuth monitoring overview](/docs/operate/secure-and-monitor/monitor) before proceeding. The overview explains what FusionAuth metrics are, what activities comprise a complete monitoring workflow, and what Prometheus, Loki, and Grafana are. Review [alternative monitoring services](/docs/operate/secure-and-monitor/monitor#overview-of-popular-monitoring-tools) in the overview to ensure that Prometheus is the right tool for your needs. +Please read the [FusionAuth monitoring overview](/docs/operate/secure-and-monitor/monitor) for details on FusionAuth metrics, the activities in a complete monitoring workflow, and what Prometheus, Loki, and Grafana are. Review the [alternative monitoring services](/docs/operate/secure-and-monitor/monitor#overview-of-popular-monitoring-tools) in the overview to ensure that Prometheus is the right tool for your needs. -While in this guide you set up Prometheus in Docker containers on your local machine, there is also a paid cloud-hosted alternative at [Grafana Cloud](https://grafana.com/auth/sign-up/create-user). +This guide will show you how to set up Prometheus in Docker containers on your local machine. However, a paid, cloud-hosted alternative is also available from [Grafana Cloud](https://grafana.com/auth/sign-up/create-user). ## Initial Architecture @@ -29,7 +29,7 @@ Running FusionAuth and PostgreSQL in Docker usually looks like the diagram below -This diagram shows three components that could die and need monitoring: the PostgreSQL database, FusionAuth, and your app (web server) that directs users to FusionAuth for login. In this guide, you will monitor only FusionAuth. To do so, you will add Prometheus to monitor your FusionAuth instance. Prometheus will poll FusionAuth every fifteen seconds to see if any errors have occurred. +This diagram shows three components that could die and need monitoring: the PostgreSQL database, FusionAuth, and the app (web server) that directs users to FusionAuth for login. In this guide, you'll focus on monitoring FusionAuth by adding Prometheus to your setup. Prometheus will poll your FusionAuth instance for errors every fifteen seconds. @@ -42,7 +42,7 @@ git clone https://github.com/FusionAuth/fusionauth-example-docker-compose.git cd fusionauth-example-docker-compose/light ``` -Add a new service to the bottom of `docker-compose.yaml` before the `networks:` section, with the code below. You are using the Ubuntu Docker image from Docker Hub for [Prometheus](https://hub.docker.com/r/ubuntu/prometheus). +Add the following code to `docker-compose.yaml` near the end, before the `networks:` section, to define a new service. The service uses the Ubuntu Docker image from Docker Hub for [Prometheus](https://hub.docker.com/r/ubuntu/prometheus). ```yaml prometheus: @@ -60,9 +60,9 @@ Add a new service to the bottom of `docker-compose.yaml` before the `networks:` - ./prometheusDb:/prometheus ``` -This service says that Prometheus will start after FusionAuth, that you can browse to it on port 9090, and that it will save its database and configuration file in persistent directories on your machine. +This service definition specifies that Prometheus starts after FusionAuth, is accessible on port 9090, and saves its database and configuration file in persistent directories on your machine. -Create the Prometheus configuration file, called `prometheusConfig.yml`, containing the content below. +Create a `prometheusConfig.yml` configuration file containing the content below. ```yaml global: @@ -79,9 +79,9 @@ scrape_configs: password: "33052c8a-c283-4e96-9d2a-eb1215c69f8f-not-for-prod" ``` -This configuration says that metrics will be gathered from FusionAuth every fifteen seconds. Prometheus will evaluate the metrics only every thirty seconds. The FusionAuth kickstart configuration files created a superuser API key that Prometheus uses as `password`. In production to be more secure, rather create an API key that has only the `GET` permission for the `/api/prometheus/metrics` endpoint. +This configures Prometheus to collect metrics from FusionAuth every 15 seconds and evaluate the metrics every 30 seconds. Prometheus uses the superuser API key, created by the FusionAuth kickstart configuration files, as `password`. For improved security in production, create an API key that has only `GET` permissions for the `/api/prometheus/metrics` endpoint. -If you prefer to allow unauthenticated access to the Prometheus metrics endpoint in FusionAuth from any local scraper, you may set `fusionauth-app.local-metrics.enabled=true`. See the FusionAuth [configuration reference](/docs/reference/configuration) for more information. +If you prefer to allow unauthenticated access to the Prometheus metrics endpoint in FusionAuth from any local scraper, you can set `fusionauth-app.local-metrics.enabled=true`. See the FusionAuth [configuration reference](/docs/reference/configuration) for more information.