From 5d84a7e18e9fd33705162cb4d953349a9166fb93 Mon Sep 17 00:00:00 2001 From: sumoanema Date: Thu, 17 Apr 2025 15:44:08 +0530 Subject: [PATCH 1/5] Postgresql opentelemtry app enhanced with newly contributed metrics --- .../opentelemetry/postgresql-opentelemetry.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md b/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md index df506bf35a..7902b187ff 100644 --- a/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md +++ b/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md @@ -15,7 +15,7 @@ import TabItem from '@theme/TabItem'; The Sumo Logic app for PostgreSQL includes predefined searches and dashboards that allow you to monitor logs and metrics for the database. The logs enable you to monitor database activity, user activity, incoming connections, query execution time, and errors. The metrics allow you to monitor database resource utilization and throughput performance. -This app supports PostgreSQL version 9.6+. +This app supports PostgreSQL version 13+. We use the OpenTelemetry collector for PostgreSQL metric collection and for collecting PostgreSQL logs. @@ -41,7 +41,7 @@ Following are the tags that will be created as part of PostgreSQL app installati ### For metrics collection - This collection queries the PostgreSQL [statistics collector](https://www.postgresql.org/docs/9.6/monitoring-stats.html). -- This receiver supports PostgreSQL version 9.6+. +- This receiver supports PostgreSQL version 13+. - The monitoring user must be granted **SELECT** on the `pg_stat_database`. ### For logs collection @@ -115,6 +115,7 @@ Below is the required input: - **Endpoint**. Enter the url of the server which needs to be monitored. Default endpoint is `localhost:5432`. - **UserName**. Enter the PostgreSQL username. - **Password**. Password for the user name which is being used for scrapping the PostgreSQL metrics. +- **Collection Interval**. You can specify at what interval should the metrics be collected. Default is 5 minutes. You can add any custom fields which you want to tag along with the data ingested in Sumo. Click on the **Download YAML File** button to get the yaml file. @@ -246,6 +247,7 @@ Use this dashboard to: - Determine the number of active databases and clusters. - Drill-down into database errors, failed logins and slow queries. - Determine if your database or queries need to be tuned based on comparing the number of slow queries. +- Active deadlock value, tuple operations trends Overview @@ -269,6 +271,10 @@ Use this dashboard to: - Understand the behavior and performance of your database clusters. - Monitor database size and disk usage. - Identify top 5 and least 5 frequently scanned indexes. +- Row return and fetched ratio, block hits by database +- Number of Locks and Deadlocks +- Rows Update Deleted Inserted count trend + Database Metrics @@ -281,6 +287,7 @@ Use this dashboard to view: - Head Only Tuple updated by schema. - Disk block reads and Disk usage by schema. - Buffer hits and rows inserted, updated and deleted by schema. +- Live rows by schema Schema Metrics @@ -333,6 +340,10 @@ Use this dashboard to: - Monitor PostgreSQL relation metrics (disk blocks, buffer hits, and hot updates) trends over time. - Monitor index scans and size to determine if executed queries are accessing them for a relation. - Track index utilization of existing indexes in a relation. +- Postgresql live and dead rows count trend +- Sequential scans and index scans by relation +- + Relation Metrics @@ -352,4 +363,5 @@ import CreateMonitors from '../../../reuse/apps/create-monitors.md'; | `PostgreSQL - Instance Down Alert` | This alert gets triggered when the Postgres instance is down. | Count > = 1 | Count < 1 | | `PostgreSQL - SlowQueries Alert` | This alert gets triggered when we detect that the PostgreSQL instance is executing slow queries. | Count > 5 | Count < = 5 | | `Postgresql- Too Many Connections Alert` | PostgreSQL instance has too many connections. | Count > = 100 | Count < 100 | -| `Postgresql - Too Many Locks Acquired Alert` | This alert gets triggered when we detect that there are too many locks acquired on the database. If this alert happens frequently, you may need to increase the postgres setting `max_locks_per_transaction`. | Count > = 100 | Count < 100 | \ No newline at end of file +| `Postgresql - Too Many Locks Acquired Alert` | This alert gets triggered when we detect that there are too many locks acquired on the database. If this alert happens frequently, you may need to increase the postgres setting `max_locks_per_transaction`. | Count > = 100 | Count < 100 | +| `Postgresql- High Rate Deadlock` | This alert fires when we detect deadlocks in a Postgres instance | Count > = 1 | Count < 1 | From ed8c255700a1e928d96596d84a83db81da8d9aa0 Mon Sep 17 00:00:00 2001 From: Jagadisha V <129049263+JV0812@users.noreply.github.com> Date: Fri, 18 Apr 2025 14:29:56 +0530 Subject: [PATCH 2/5] Update postgresql-opentelemetry.md --- .../opentelemetry/postgresql-opentelemetry.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md b/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md index 7902b187ff..35a96358fa 100644 --- a/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md +++ b/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md @@ -247,7 +247,7 @@ Use this dashboard to: - Determine the number of active databases and clusters. - Drill-down into database errors, failed logins and slow queries. - Determine if your database or queries need to be tuned based on comparing the number of slow queries. -- Active deadlock value, tuple operations trends +- Active deadlock value and tuple operations trends. Overview @@ -269,12 +269,11 @@ The **PostgreSQL - Database Metrics** dashboard allows you to monitor the databa Use this dashboard to: - Understand the behavior and performance of your database clusters. -- Monitor database size and disk usage. +- Monitor the database size and disk usage. - Identify top 5 and least 5 frequently scanned indexes. -- Row return and fetched ratio, block hits by database -- Number of Locks and Deadlocks -- Rows Update Deleted Inserted count trend - +- Monitor the row return and fetched ratio, block hits by database. +- Identify the number of Locks and Deadlocks. +- Identify the rows Update/Deleted/Inserted count trend. Database Metrics @@ -287,7 +286,7 @@ Use this dashboard to view: - Head Only Tuple updated by schema. - Disk block reads and Disk usage by schema. - Buffer hits and rows inserted, updated and deleted by schema. -- Live rows by schema +- Live rows by schema. Schema Metrics @@ -340,10 +339,8 @@ Use this dashboard to: - Monitor PostgreSQL relation metrics (disk blocks, buffer hits, and hot updates) trends over time. - Monitor index scans and size to determine if executed queries are accessing them for a relation. - Track index utilization of existing indexes in a relation. -- Postgresql live and dead rows count trend -- Sequential scans and index scans by relation -- - +- Monitor the Postgresql live and dead rows count trend. +- Monitor the sequential scans and index scans by relation. Relation Metrics From 6ef5fcb40b71c04ffb007d04e5ad28b81813ba14 Mon Sep 17 00:00:00 2001 From: Jagadisha V <129049263+JV0812@users.noreply.github.com> Date: Fri, 18 Apr 2025 14:30:10 +0530 Subject: [PATCH 3/5] Update docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md --- .../databases/opentelemetry/postgresql-opentelemetry.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md b/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md index 35a96358fa..a70a5262bc 100644 --- a/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md +++ b/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md @@ -360,5 +360,5 @@ import CreateMonitors from '../../../reuse/apps/create-monitors.md'; | `PostgreSQL - Instance Down Alert` | This alert gets triggered when the Postgres instance is down. | Count > = 1 | Count < 1 | | `PostgreSQL - SlowQueries Alert` | This alert gets triggered when we detect that the PostgreSQL instance is executing slow queries. | Count > 5 | Count < = 5 | | `Postgresql- Too Many Connections Alert` | PostgreSQL instance has too many connections. | Count > = 100 | Count < 100 | -| `Postgresql - Too Many Locks Acquired Alert` | This alert gets triggered when we detect that there are too many locks acquired on the database. If this alert happens frequently, you may need to increase the postgres setting `max_locks_per_transaction`. | Count > = 100 | Count < 100 | +| `Postgresql - Too Many Locks Acquired Alert` | This alert is triggered when there are too many locks acquired on the database. Increase the postgres setting `max_locks_per_transaction`, if this alert occurs frequently. | Count > = 100 | Count < 100 | | `Postgresql- High Rate Deadlock` | This alert fires when we detect deadlocks in a Postgres instance | Count > = 1 | Count < 1 | From f572e3221e5374e8401c83ffa541a83bb352ac2d Mon Sep 17 00:00:00 2001 From: Jagadisha V <129049263+JV0812@users.noreply.github.com> Date: Fri, 18 Apr 2025 14:30:16 +0530 Subject: [PATCH 4/5] Update docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md --- .../databases/opentelemetry/postgresql-opentelemetry.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md b/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md index a70a5262bc..e6f3cc9452 100644 --- a/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md +++ b/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md @@ -361,4 +361,4 @@ import CreateMonitors from '../../../reuse/apps/create-monitors.md'; | `PostgreSQL - SlowQueries Alert` | This alert gets triggered when we detect that the PostgreSQL instance is executing slow queries. | Count > 5 | Count < = 5 | | `Postgresql- Too Many Connections Alert` | PostgreSQL instance has too many connections. | Count > = 100 | Count < 100 | | `Postgresql - Too Many Locks Acquired Alert` | This alert is triggered when there are too many locks acquired on the database. Increase the postgres setting `max_locks_per_transaction`, if this alert occurs frequently. | Count > = 100 | Count < 100 | -| `Postgresql- High Rate Deadlock` | This alert fires when we detect deadlocks in a Postgres instance | Count > = 1 | Count < 1 | +| `Postgresql- High Rate Deadlock` | This alert is triggered when deadlocks in a Postgres instance are detected. | Count > = 1 | Count < 1 | From fae69d32fea8a20f0b207afa2b0bc5e03a4ed657 Mon Sep 17 00:00:00 2001 From: Alekh Nema <91047769+sumoanema@users.noreply.github.com> Date: Fri, 18 Apr 2025 16:30:34 +0530 Subject: [PATCH 5/5] Apply suggestions from code review Co-authored-by: Kim (Sumo Logic) <56411016+kimsauce@users.noreply.github.com> --- .../databases/opentelemetry/postgresql-opentelemetry.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md b/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md index e6f3cc9452..254f3ea220 100644 --- a/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md +++ b/docs/integrations/databases/opentelemetry/postgresql-opentelemetry.md @@ -339,7 +339,7 @@ Use this dashboard to: - Monitor PostgreSQL relation metrics (disk blocks, buffer hits, and hot updates) trends over time. - Monitor index scans and size to determine if executed queries are accessing them for a relation. - Track index utilization of existing indexes in a relation. -- Monitor the Postgresql live and dead rows count trend. +- Monitor the PostgreSQL live and dead rows count trend. - Monitor the sequential scans and index scans by relation. Relation Metrics @@ -360,5 +360,5 @@ import CreateMonitors from '../../../reuse/apps/create-monitors.md'; | `PostgreSQL - Instance Down Alert` | This alert gets triggered when the Postgres instance is down. | Count > = 1 | Count < 1 | | `PostgreSQL - SlowQueries Alert` | This alert gets triggered when we detect that the PostgreSQL instance is executing slow queries. | Count > 5 | Count < = 5 | | `Postgresql- Too Many Connections Alert` | PostgreSQL instance has too many connections. | Count > = 100 | Count < 100 | -| `Postgresql - Too Many Locks Acquired Alert` | This alert is triggered when there are too many locks acquired on the database. Increase the postgres setting `max_locks_per_transaction`, if this alert occurs frequently. | Count > = 100 | Count < 100 | -| `Postgresql- High Rate Deadlock` | This alert is triggered when deadlocks in a Postgres instance are detected. | Count > = 1 | Count < 1 | +| `PostgreSQL - Too Many Locks Acquired Alert` | This alert is triggered when there are too many locks acquired on the database. Increase the postgres setting `max_locks_per_transaction`, if this alert occurs frequently. | Count > = 100 | Count < 100 | +| `PostgreSQL - High Rate Deadlock` | This alert is triggered when deadlocks in a Postgres instance are detected. | Count > = 1 | Count < 1 |