From 709595477a14ae886bdfc571d286d8dc94835192 Mon Sep 17 00:00:00 2001 From: Vincent Mercier Date: Wed, 22 Nov 2023 11:48:01 +0100 Subject: [PATCH] doc(gettting-started): Add Prometheus standalone deployment --- content/faq.md | 8 +++++ content/getting-started.md | 74 ++++++++++++++++++++++++++++++++++---- 2 files changed, 75 insertions(+), 7 deletions(-) diff --git a/content/faq.md b/content/faq.md index 7c0247c..ab25819 100644 --- a/content/faq.md +++ b/content/faq.md @@ -15,6 +15,14 @@ This project was initiated by [Qonto's](https://qonto.com/) SRE engineers to sha Yes, we took lots of inspiration on [Prometheus-operator runbook](https://github.com/prometheus-operator/runbooks), which provides similar experience for Prometheus & Kubernetes technologies. +## Deployment + +### Can I deploy the database monitoring framework on Prometheus standalone deployment? + +Project was designed for Kubernetes deployment using Prometheus operator, but you can use for standalone deployment. + +Use the `format=PrometheusConfigurationFile` Helm parameter to render rules as Prometheus rule files. + ## Alerts ### Customize alerts diff --git a/content/getting-started.md b/content/getting-started.md index c057e26..f7673a4 100644 --- a/content/getting-started.md +++ b/content/getting-started.md @@ -19,26 +19,86 @@ See also our tutorials for concrete deployment example. Steps to deploy the framework on on your infrastructure: -1. Deploy Prometheus operator +{{< tabs "methods" >}} +{{< tab "Prometheus Kubernetes Operator" >}} +Requirements - Make sure: - - `serviceMonitorSelector` is defined to enable `ServiceMonitor` ([documentation](https://github.com/prometheus-operator/prometheus-operator/blob/v0.68.0/Documentation/user-guides/alerting.md#deploying-prometheus-rules)) - - `ruleSelector` is enabled for `PrometheusRules` ([documentation](https://github.com/prometheus-operator/prometheus-operator/blob/v0.68.0/Documentation/user-guides/alerting.md#deploying-prometheus-rules)) +- [Helm](https://helm.sh/docs/intro/install/) -1. Deploy Prometheus RDS exporters and/or PostgreSQL exporter as describe in tutorials +- [Prometheus Kubernetes operator](https://github.com/prometheus-operator/prometheus-operator) + + 1. `ruleSelector` must be enabled ([documentation](https://github.com/prometheus-operator/prometheus-operator/blob/v0.68.0/Documentation/user-guides/alerting.md#deploying-prometheus-rules)) + + 1. `serviceMonitorSelector` must be enabled for `ServiceMonitor` ([documentation](https://github.com/prometheus-operator/prometheus-operator/blob/v0.68.0/Documentation/user-guides/alerting.md#deploying-prometheus-rules)) + +Steps + +1. Deploy [Prometheus RDS exporter]({{< ref "/tutorials/rds/exporter-deployment" >}}) and/or [Prometheus PostgreSQL exporter]({{< ref "/tutorials/postgresql/exporter-deployment" >}}) 1. Deploy charts with helm ```bash # RDS alerts - helm install prometheus-rds-alerts-chart oci://public.ecr.aws/qonto/prometheus-rds-alerts-chart:{{% current_version %}} --namespace ${KUBERNETES_NAMESPACE} + helm install prometheus-rds-alerts-chart oci://public.ecr.aws/qonto/prometheus-rds-alerts-chart \ + --version {{% current_version %}} \ + --namespace monitoring ``` ```bash # PostgreSQL alerts - helm install prometheus-postgresql-alerts-chart oci://public.ecr.aws/qonto/prometheus-postgresql-alerts-chart:{{% current_version %}} --namespace ${KUBERNETES_NAMESPACE} + helm install prometheus-postgresql-alerts-chart oci://public.ecr.aws/qonto/prometheus-postgresql-alerts-chart \ + --version {{% current_version %}} \ + --namespace monitoring + ``` + +1. Connect to Prometheus to check that the rules are correctly loaded (`https:///rules`) + +{{< /tab >}} +{{< tab "Prometheus standalone server" >}} + +Requirements + +- [Helm](https://helm.sh/docs/intro/install/) + +- [Prometheus server](https://prometheus.io/docs/prometheus/latest/installation/) + +Steps + +1. Deploy [Prometheus RDS exporter]({{< ref "/tutorials/rds/exporter-deployment" >}}) and/or [Prometheus PostgreSQL exporter]({{< ref "/tutorials/postgresql/exporter-deployment" >}}) + +1. Generate Prometheus rule configuration files + + ```bash + # Generate RDS rules in /etc/prometheus/rds.rules.yaml + helm template oci://public.ecr.aws/qonto/prometheus-rds-alerts-chart \ + --version {{% current_version %}} \ + --set format=PrometheusConfigurationFile \ + > /etc/prometheus/rds.rules.yaml + ``` + + ```bash + # Generate PostgreSQL rules in /etc/prometheus/postgresql.rules.yaml + helm template oci://public.ecr.aws/qonto/prometheus-postgresql-alerts-chart \ + --version {{% current_version %}} \ + --set format=PrometheusConfigurationFile \ + > /etc/postgresql.rules.yaml ``` +1. Add files to the `rule_files` parameter in the Prometheus configuration file + + ```yaml + rule_files: + - /etc/prometheus/rds.rules.yaml + - /etc/prometheus/postgresql.rules.yaml + ``` + +1. Reload Prometheus configuration + +1. Connect to Prometheus to check that the rules are correctly loaded (`https:///rules`) + +{{< /tab >}} +{{< /tabs >}} + ## Charts Prometheus alerts are available as Helm chart: