-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…4444) Add testing with with versions 10, 11, 12 and 13. Add fields available since version 10 in the activity metricset to give more details about the backend and its waits. Since version 12, `pg_stat_database` includes an entry for shared resources that don't belong to a single database. Handle this in tests and add docs and example document. Handle metrics renamed in `pg_stat_statements` in version 13. Regenerate data files with latest code and PostgreSQL 13. (cherry picked from commit be4885e)
- Loading branch information
Showing
23 changed files
with
326 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
variants: | ||
- POSTGRESQL_VERSION: "9.6.21" | ||
- POSTGRESQL_VERSION: "10.16" | ||
- POSTGRESQL_VERSION: "11.11" | ||
- POSTGRESQL_VERSION: "12.6" | ||
- POSTGRESQL_VERSION: "13.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,41 @@ | ||
{ | ||
"@timestamp": "2017-10-12T08:05:34.853Z", | ||
"agent": { | ||
"hostname": "host.example.com", | ||
"name": "host.example.com" | ||
}, | ||
"event": { | ||
"dataset": "postgresql.activity", | ||
"duration": 115000, | ||
"module": "postgresql" | ||
}, | ||
"metricset": { | ||
"name": "activity" | ||
"name": "activity", | ||
"period": 10000 | ||
}, | ||
"postgresql": { | ||
"activity": { | ||
"application_name": "", | ||
"backend_start": "2019-03-05T08:38:21.348Z", | ||
"backend_start": "2021-03-05T19:01:40.467Z", | ||
"backend_type": "client backend", | ||
"client": { | ||
"address": "172.26.0.1", | ||
"address": "192.168.128.1", | ||
"hostname": "", | ||
"port": 41582 | ||
"port": 33414 | ||
}, | ||
"database": { | ||
"name": "postgres", | ||
"oid": 12379 | ||
"oid": 13395 | ||
}, | ||
"pid": 347, | ||
"pid": 2236, | ||
"query": "SELECT * FROM pg_stat_activity", | ||
"query_start": "2019-03-05T08:38:21.352Z", | ||
"state": "active", | ||
"state_change": "2019-03-05T08:38:21.352Z", | ||
"transaction_start": "2019-03-05T08:38:21.352Z", | ||
"query_start": "2021-03-05T19:01:40.469Z", | ||
"state": "idle", | ||
"state_change": "2021-03-05T19:01:40.471Z", | ||
"user": { | ||
"id": 10, | ||
"name": "postgres" | ||
}, | ||
"waiting": false | ||
} | ||
} | ||
}, | ||
"service": { | ||
"address": "172.26.0.2:5432", | ||
"address": "192.168.128.2:5432", | ||
"type": "postgresql" | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
metricbeat/module/postgresql/activity/_meta/data_backend.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"@timestamp": "2017-10-12T08:05:34.853Z", | ||
"event": { | ||
"dataset": "postgresql.activity", | ||
"duration": 115000, | ||
"module": "postgresql" | ||
}, | ||
"metricset": { | ||
"name": "activity", | ||
"period": 10000 | ||
}, | ||
"postgresql": { | ||
"activity": { | ||
"backend_start": "2021-03-05T18:39:18.347Z", | ||
"backend_type": "logical replication launcher", | ||
"pid": 81, | ||
"wait_event": "LogicalLauncherMain", | ||
"wait_event_type": "Activity" | ||
} | ||
}, | ||
"service": { | ||
"address": "192.168.128.2:5432", | ||
"type": "postgresql" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,41 @@ | ||
{ | ||
"@timestamp": "2017-10-12T08:05:34.853Z", | ||
"agent": { | ||
"hostname": "host.example.com", | ||
"name": "host.example.com" | ||
}, | ||
"event": { | ||
"dataset": "postgresql.bgwriter", | ||
"duration": 115000, | ||
"module": "postgresql" | ||
}, | ||
"metricset": { | ||
"name": "bgwriter" | ||
"name": "bgwriter", | ||
"period": 10000 | ||
}, | ||
"postgresql": { | ||
"bgwriter": { | ||
"buffers": { | ||
"allocated": 143, | ||
"allocated": 273, | ||
"backend": 0, | ||
"backend_fsync": 0, | ||
"checkpoints": 0, | ||
"checkpoints": 8, | ||
"clean": 0, | ||
"clean_full": 0 | ||
}, | ||
"checkpoints": { | ||
"requested": 0, | ||
"scheduled": 1, | ||
"scheduled": 4, | ||
"times": { | ||
"sync": { | ||
"ms": 0 | ||
"ms": 9 | ||
}, | ||
"write": { | ||
"ms": 0 | ||
"ms": 804 | ||
} | ||
} | ||
}, | ||
"stats_reset": "2019-03-05T08:32:30.028Z" | ||
"stats_reset": "2021-03-05T18:39:17.954Z" | ||
} | ||
}, | ||
"service": { | ||
"address": "172.26.0.2:5432", | ||
"address": "192.168.128.2:5432", | ||
"type": "postgresql" | ||
} | ||
} |
Oops, something went wrong.