Skip to content

Commit 43e35e4

Browse files
committed
refactor(SQLExporter): Renamed in preparation for sql_exporter + warnings in tutorials added
1 parent b023e2e commit 43e35e4

File tree

11 files changed

+43
-22
lines changed

11 files changed

+43
-22
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
name: helm
4141
runs-on: ubuntu-latest
4242
env:
43-
HELM_UNITTEST_VERSION: v0.3.5
43+
HELM_UNITTEST_VERSION: v0.4.1
4444
steps:
4545
- uses: actions/checkout@v3
4646

charts/prometheus-postgresql-alerts/prometheus_tests/PostgreSQLExporterDown.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ evaluation_interval: 1m
55

66
tests:
77

8-
- name: PostgreSQLExporterDown
8+
- name: SQLExporterDown
99
interval: 1m
1010
input_series:
1111
- series: 'up{service="sql-exporter", target="mydatabase"}'
1212
values: '0x10'
1313
alert_rule_test:
14-
- alertname: PostgreSQLExporterDown
14+
- alertname: SQLExporterDown
1515
eval_time: 5m
1616
exp_alerts:
1717
- exp_labels:
@@ -20,4 +20,4 @@ tests:
2020
exp_annotations:
2121
summary: "Exporter is down"
2222
description: "SQL Exporter is down"
23-
runbook_url: "https://qonto.github.io/database-monitoring-framework/0.0.0/runbooks/postgresql/PostgreSQLExporterDown"
23+
runbook_url: "https://qonto.github.io/database-monitoring-framework/0.0.0/runbooks/postgresql/SQLExporterDown"

charts/prometheus-postgresql-alerts/prometheus_tests/PostgreSQLExporterMissingTarget.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ evaluation_interval: 1m
55

66
tests:
77

8-
- name: PostgreSQLExporterMissingTarget
8+
- name: SQLExporterMissingTarget
99
interval: 1m
1010
input_series:
1111
- series: 'up{service="sql-exporter", target="db1", exported_job="pg-metrics-instance"}'
1212
values: '0x00'
1313
- series: 'up{service="sql-exporter", target="", exported_job="pg-metrics-instance"}'
1414
values: '0x10'
1515
alert_rule_test:
16-
- alertname: PostgreSQLExporterMissingTarget
16+
- alertname: SQLExporterMissingTarget
1717
eval_time: 5m
1818
exp_alerts:
1919
- exp_labels:
@@ -23,4 +23,4 @@ tests:
2323
exp_annotations:
2424
summary: "Exporter scrape for db1 (pg-metrics-instance) failed"
2525
description: "SQL Exporter cannot collect metrics for this target, it's either because the target is down, or the sql-exporter user cannot connect."
26-
runbook_url: "https://qonto.github.io/database-monitoring-framework/0.0.0/runbooks/postgresql/PostgreSQLExporterMissingTarget"
26+
runbook_url: "https://qonto.github.io/database-monitoring-framework/0.0.0/runbooks/postgresql/SQLExporterMissingTarget"

charts/prometheus-postgresql-alerts/prometheus_tests/PostgreSQLExporterScrapingLimit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ evaluation_interval: 1m
55

66
tests:
77

8-
- name: PostgreSQLExporterScrapingLimit
8+
- name: SQLExporterScrapingLimit
99
interval: 1m
1010
input_series:
1111
- series: 'scrape_duration_seconds{job="sql-exporter", target=""}'
1212
values: 40x10
1313
alert_rule_test:
14-
- alertname: PostgreSQLExporterScrapingLimit
14+
- alertname: SQLExporterScrapingLimit
1515
eval_time: 5m
1616
exp_alerts:
1717
- exp_labels:
@@ -20,4 +20,4 @@ tests:
2020
exp_annotations:
2121
summary: "Exporter scraping takes long time"
2222
description: "SQL Exporter scraping is taking a long time"
23-
runbook_url: "https://qonto.github.io/database-monitoring-framework/0.0.0/runbooks/postgresql/PostgreSQLExporterScrapingLimit"
23+
runbook_url: "https://qonto.github.io/database-monitoring-framework/0.0.0/runbooks/postgresql/SQLExporterScrapingLimit"

charts/prometheus-postgresql-alerts/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ rulesGroupName: postgresql.rules
1010

1111
rules:
1212

13-
PostgreSQLExporterDown:
13+
SQLExporterDown:
1414
expr: absent(up{service="sql-exporter", target=""})
1515
for: 5m
1616
labels:
@@ -19,7 +19,7 @@ rules:
1919
summary: "Exporter is down"
2020
description: "SQL Exporter is down"
2121

22-
PostgreSQLExporterMissingTarget:
22+
SQLExporterMissingTarget:
2323
expr: min(up{service="sql-exporter", target!=""}) by (target,exported_job) < 1
2424
for : 5m
2525
labels:
@@ -28,7 +28,7 @@ rules:
2828
summary: "Exporter scrape for {{ $labels.target }} ({{ $labels.exported_job }}) failed"
2929
description: "SQL Exporter cannot collect metrics for this target, it's either because the target is down, or the sql-exporter user cannot connect."
3030

31-
PostgreSQLExporterScrapingLimit:
31+
SQLExporterScrapingLimit:
3232
expr: avg_over_time(scrape_duration_seconds{job="sql-exporter", target=""}[10m]) > 30
3333
for: 5m
3434
labels:

content/architecture.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ This component is optional but highly recommended for AWS customers.
1919

2020
### Prometheus PostgreSQL exporter
2121

22+
{{< hint info >}}
23+
**Tips**
24+
25+
This section is outdated for DMF version >beta.10 because of ongoing migration toward burningalchemist/sql_exporter. Stay tuned!
26+
27+
{{< /hint >}}
28+
2229
The [Prometheus Postgres exporter](https://github.com/prometheus-community/postgres_exporter) collects PostgreSQL internal metrics using system tables.
2330

2431
We override its default configuration to collect additional metrics to trigger advanced alerts and analyze trends over time.

content/runbooks/postgresql/PostgreSQLExporterDown.md renamed to content/runbooks/postgresql/SQLExporterDown.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Exporter down
33
---
44

5-
# PostgreSQLExporterDown
5+
# SQLExporterDown
66

77
## Meaning
88

@@ -14,14 +14,14 @@ The monitoring system is degraded. SQL exporter does not collect SQL metrics, al
1414

1515
## Diagnosis
1616

17-
1. **Look at Prometheus SQL exporter logs**. The error messages (`level=error`) should explain why the exporter can't scrape metrics.
17+
1. **Look at SQL exporter logs**. The error messages (`level=error`) should explain why the exporter can't scrape metrics.
1818

1919
Usually, the exporter can't connect to the PostgreSQL server due to network restrictions, authentication failure, missing permissions or timeout.
2020

2121
{{< hint info >}}
2222
**PostgreSQL required permissions**
2323

24-
The PostgreSQL exporter needs `pg_monitor` role and `LOGIN` options.
24+
The SQL exporter needs `pg_monitor` role and `LOGIN` options.
2525
{{< /hint >}}
2626

2727
1. **Look at PostgreSQL connection logs**

content/runbooks/postgresql/PostgreSQLExporterMissingTarget.md renamed to content/runbooks/postgresql/SQLExporterMissingTarget.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Exporter target down
33
---
44

5-
# PostgreSQLExporterMissingTarget
5+
# SQLExporterMissingTarget
66

77
## Meaning
88

@@ -14,19 +14,19 @@ The monitoring system is degraded for this target. SQL exporter does not collect
1414

1515
## Diagnosis
1616

17-
1. **Look at Prometheus SQL exporter logs**. The error messages (`level=error`) should explain why the exporter can't scrape metrics.
17+
1. **Look at SQL exporter logs**. The error messages (`level=error`) should explain why the exporter can't scrape metrics.
1818

1919
Usually, the exporter can't connect to the PostgreSQL server due to network restrictions, authentication failure, missing permissions or timeout.
2020

2121
{{< hint info >}}
2222
**PostgreSQL required permissions**
2323

24-
The PostgreSQL exporter needs `pg_monitor` role and `LOGIN` options.
24+
The SQL exporter needs `pg_monitor` role and `LOGIN` options.
2525
{{< /hint >}}
2626

2727
1. **Look at PostgreSQL connection logs**
2828

29-
You'll get an error message if PostgreSQL exporter connections are rejected by PostgreSQL.
29+
You'll get an error message if SQL exporter connections are rejected by PostgreSQL.
3030

3131
## Mitigation
3232

content/runbooks/postgresql/PostgreSQLExporterScrapingLimit.md renamed to content/runbooks/postgresql/SQLExporterScrapingLimit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Exporter scraping limit
33
---
44

5-
# PostgreSQLExporterScrapingLimit
5+
# SQLExporterScrapingLimit
66

77
## Meaning
88

content/tutorials/postgresql/alerts-deployment.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ weight: 200
77

88
In this tutorial, you'll deploy the alerts for PostgreSQL.
99

10+
{{< hint info >}}
11+
**Tips**
12+
13+
This page is outdated for DMF version >beta.10 because of ongoing migration toward sql_exporter. Stay tuned!
14+
15+
{{< /hint >}}
16+
1017
## Requirements
1118

1219
- Helm (v3.0+)
@@ -23,7 +30,7 @@ This tutorial assumes you have Kubernetes, Helm and Prometheus knowledge.
2330

2431
```bash
2532
KUBERNETES_NAMESPACE=monitoring
26-
helm upgrade --install prometheus-rds-alerts-chart oci://public.ecr.aws/qonto/prometheus-rds-alerts-chart:{{% current_version %}} --namespace ${KUBERNETES_NAMESPACE}
33+
helm upgrade --install prometheus-postgresql-alerts-chart oci://public.ecr.aws/qonto/prometheus-rds-alerts-chart:{{% current_version %}} --namespace ${KUBERNETES_NAMESPACE}
2734
```
2835

2936
1. Connect on Prometheus and check rules are defined

0 commit comments

Comments
 (0)