Skip to content

Commit 41ed314

Browse files
Added configuration support through instances.yml
1 parent 6a1947e commit 41ed314

File tree

6 files changed

+106
-374
lines changed

6 files changed

+106
-374
lines changed

config/pgwatch-postgres/metrics.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@ metrics:
1010
from pg_stat_statements
1111
where queryid is not null
1212
gauges:
13-
- '*'
13+
- '*'
14+
15+
presets:
16+
full:
17+
description: "Full metrics for PostgreSQL storage"
18+
metrics:
19+
pgss_queryid_queries: 10
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
# PGWatch Sources Configuration - PostgreSQL Instance
2-
# This instance stores detailed metrics in PostgreSQL format
3-
4-
- name: target-database
2+
- unique_name: target-database
53
conn_str: postgresql://pgwatch_monitor:monitor_pass@target-db:5432/target_database
6-
kind: postgres
4+
preset_metrics: full
75
custom_metrics:
8-
pgss_queryid_queries: 30
6+
is_enabled: true
7+
group: default
98
custom_tags:
109
env: demo
1110
cluster: local
1211
sink_type: postgresql
13-
is_enabled: true
14-
stmt_timeout: 30

config/pgwatch-prometheus/metrics.yml

Lines changed: 43 additions & 299 deletions
Original file line numberDiff line numberDiff line change
@@ -4771,305 +4771,49 @@ metrics:
47714771

47724772

47734773
presets:
4774-
aiven:
4775-
description: aiven database metrics
4776-
metrics:
4777-
archiver: 60
4778-
backends: 60
4779-
bgwriter: 60
4780-
checkpointer: 60
4781-
change_events: 300
4782-
db_size: 300
4783-
db_stats: 60
4784-
index_col_stats: 86400
4785-
index_stats: 900
4786-
locks: 60
4787-
locks_mode: 60
4788-
recommendations: 43200
4789-
replication: 120
4790-
replication_slots: 120
4791-
sequence_health: 3600
4792-
settings: 7200
4793-
sproc_stats: 180
4794-
stat_activity: 60
4795-
stat_statements: 180
4796-
stat_statements_calls: 60
4797-
table_bloat_approx_summary_sql: 7200
4798-
table_io_stats: 300
4799-
table_stats: 300
4800-
wal: 60
4801-
wal_receiver: 120
4802-
aurora:
4803-
description: AWS Aurora doesn't expose all Postgres functions and there's no WAL
4804-
metrics:
4805-
archiver: 60
4806-
backends: 60
4807-
bgwriter: 60
4808-
checkpointer: 60
4809-
change_events: 300
4810-
db_size: 300
4811-
db_stats_aurora: 60
4812-
index_stats: 900
4813-
locks: 60
4814-
locks_mode: 60
4815-
replication: 120
4816-
replication_slots: 120
4817-
settings: 7200
4818-
sproc_stats: 180
4819-
stat_statements: 180
4820-
stat_statements_calls: 60
4821-
table_bloat_approx_summary_sql: 7200
4822-
table_io_stats: 600
4823-
table_stats: 300
4824-
wal_receiver: 120
4825-
azure:
4826-
description: similar to 'exhaustive' with stuff that's not accessible on Azure Database for PostgreSQL removed
4827-
metrics:
4828-
archiver: 60
4829-
backends: 60
4830-
bgwriter: 60
4831-
checkpointer: 60
4832-
change_events: 300
4833-
db_size: 300
4834-
db_stats: 60
4835-
index_stats: 900
4836-
kpi: 120
4837-
locks: 60
4838-
locks_mode: 60
4839-
replication: 60
4840-
replication_slots: 60
4841-
sequence_health: 3600
4842-
settings: 7200
4843-
sproc_stats: 180
4844-
stat_ssl: 60
4845-
stat_statements: 180
4846-
stat_statements_calls: 60
4847-
table_bloat_approx_summary_sql: 7200
4848-
table_io_stats: 600
4849-
wal: 60
4850-
wal_receiver: 60
4851-
wal_size: 300
4852-
basic:
4853-
description: only the most important metrics - WAL, DB-level statistics (size, tx and backend counts)
4854-
metrics:
4855-
instance_up: 60
4856-
db_size: 300
4857-
db_stats: 60
4858-
wal: 60
4859-
exhaustive:
4860-
description: all important metrics for a deeper performance understanding
4861-
metrics:
4862-
archiver: 60
4863-
backends: 60
4864-
bgwriter: 60
4865-
checkpointer: 60
4866-
change_events: 300
4867-
cpu_load: 60
4868-
db_size: 300
4869-
db_stats: 60
4870-
index_stats: 900
4871-
instance_up: 60
4872-
locks: 60
4873-
locks_mode: 60
4874-
replication: 120
4875-
replication_slots: 120
4876-
sequence_health: 3600
4877-
settings: 7200
4878-
sproc_stats: 180
4879-
stat_activity: 30
4880-
stat_statements: 180
4881-
stat_statements_calls: 60
4882-
table_bloat_approx_summary_sql: 7200
4883-
table_io_stats: 600
4884-
table_stats: 300
4885-
wal: 60
4886-
wal_receiver: 120
4887-
wal_size: 300
48884774
full:
48894775
description: almost all available metrics for a even deeper performance understanding
48904776
metrics:
4891-
archiver: 60
4892-
archiver_pending_count: 300
4893-
backends: 60
4894-
bgwriter: 60
4895-
checkpointer: 60
4896-
change_events: 300
4897-
cpu_load: 60
4898-
datfrozenxid: 3600
4899-
db_size: 300
4900-
db_stats: 60
4901-
index_stats: 900
4902-
instance_up: 60
4903-
kpi: 120
4904-
locks: 60
4905-
locks_mode: 60
4906-
logical_subscriptions: 120
4907-
postgres_role: 60
4908-
psutil_cpu: 120
4909-
psutil_disk: 120
4910-
psutil_disk_io_total: 120
4911-
psutil_mem: 120
4912-
recommendations: 43200
4913-
replication: 120
4914-
replication_slots: 120
4915-
sequence_health: 3600
4916-
server_log_event_counts: 60
4917-
settings: 7200
4918-
sproc_stats: 180
4919-
stat_activity: 30
4920-
stat_ssl: 120
4921-
stat_statements: 180
4922-
stat_statements_calls: 60
4923-
table_bloat_approx_summary_sql: 7200
4924-
table_io_stats: 600
4925-
table_stats: 300
4926-
wal: 60
4927-
wal_receiver: 120
4928-
wal_size: 120
4929-
gce:
4930-
description: similar to 'exhaustive' with stuff not accessible on GCE managed PostgreSQL engine removed
4931-
metrics:
4932-
archiver: 60
4933-
backends: 60
4934-
bgwriter: 60
4935-
checkpointer: 60
4936-
change_events: 300
4937-
db_size: 300
4938-
db_stats: 60
4939-
index_stats: 900
4940-
locks: 60
4941-
locks_mode: 60
4942-
replication: 120
4943-
replication_slots: 120
4944-
sequence_health: 3600
4945-
settings: 7200
4946-
sproc_stats: 180
4947-
stat_statements: 180
4948-
stat_statements_calls: 60
4949-
table_bloat_approx_summary_sql: 7200
4950-
table_io_stats: 600
4951-
table_stats: 300
4952-
wal: 60
4953-
wal_receiver: 120
4954-
minimal:
4955-
description: single "Key Performance Indicators" query for fast cluster/db overview
4956-
metrics:
4957-
instance_up: 60
4958-
kpi: 60
4959-
pgbouncer:
4960-
description: pgbouncer stats
4961-
metrics:
4962-
pgbouncer_stats: 60
4963-
pgbouncer_clients: 60
4964-
pgpool:
4965-
description: pgpool stats
4966-
metrics:
4967-
pgpool_stats: 60
4968-
pgpool_processes: 60
4969-
prometheus-async:
4970-
description: Tuned for the Prometheus async scrapping
4971-
metrics:
4972-
backends: 30
4973-
bgwriter: 60
4974-
checkpointer: 60
4975-
db_size: 300
4976-
db_stats: 30
4977-
locks_mode: 30
4978-
replication: 120
4979-
replication_slots: 120
4980-
settings: 300
4981-
sproc_stats: 180
4982-
stat_statements_calls: 60
4983-
table_io_stats: 300
4984-
table_stats: 300
4985-
wait_events: 60
4986-
wal: 60
4987-
rds:
4988-
description: similar to 'exhaustive' with stuff that's not accessible on AWS RDS removed
4989-
metrics:
4990-
archiver: 60
4991-
backends: 60
4992-
bgwriter: 60
4993-
checkpointer: 60
4994-
change_events: 300
4995-
db_size: 300
4996-
db_stats: 60
4997-
index_stats: 900
4998-
locks: 60
4999-
locks_mode: 60
5000-
replication: 120
5001-
replication_slots: 120
5002-
sequence_health: 3600
5003-
settings: 7200
5004-
sproc_stats: 180
5005-
stat_activity: 30
5006-
stat_statements: 180
5007-
stat_statements_calls: 60
5008-
table_bloat_approx_summary_sql: 7200
5009-
table_io_stats: 600
5010-
table_stats: 300
5011-
wal: 60
5012-
wal_receiver: 120
5013-
standard:
5014-
description: basic level + table, index, stat_statements stats
5015-
metrics:
5016-
cpu_load: 60
5017-
db_size: 300
5018-
db_stats: 60
5019-
index_stats: 900
5020-
instance_up: 60
5021-
sequence_health: 3600
5022-
sproc_stats: 180
5023-
stat_statements: 180
5024-
table_stats: 300
5025-
wal: 60
5026-
exhaustive_no_python:
5027-
description: like exhaustive, but no PL/Python helpers
5028-
metrics:
5029-
archiver: 60
5030-
backends: 60
5031-
bgwriter: 60
5032-
checkpointer: 60
5033-
change_events: 300
5034-
db_size: 300
5035-
db_stats: 60
5036-
index_stats: 900
5037-
instance_up: 60
5038-
locks: 60
5039-
locks_mode: 60
5040-
replication: 120
5041-
replication_slots: 120
5042-
sequence_health: 3600
5043-
settings: 7200
5044-
sproc_stats: 180
5045-
stat_activity: 30
5046-
stat_statements: 180
5047-
stat_statements_calls: 60
5048-
table_bloat_approx_summary_sql: 7200
5049-
table_io_stats: 600
5050-
table_stats: 300
5051-
wal: 60
5052-
wal_receiver: 120
5053-
wal_size: 300
5054-
unprivileged:
5055-
description: no wrappers + only pg_stat_statements extension expected (developer mode)
5056-
metrics:
5057-
archiver: 60
5058-
bgwriter: 60
5059-
checkpointer: 60
5060-
change_events: 300
5061-
db_size: 300
5062-
db_stats: 60
5063-
index_stats: 900
5064-
instance_up: 60
5065-
locks: 60
5066-
locks_mode: 60
5067-
replication: 120
5068-
replication_slots: 120
5069-
sequence_health: 3600
5070-
settings: 7200
5071-
sproc_stats: 180
5072-
stat_statements_calls: 60
5073-
table_io_stats: 600
5074-
table_stats: 300
5075-
wal: 60
4777+
backends: 1
4778+
bgwriter: 1
4779+
checkpointer: 1
4780+
db_size: 1
4781+
db_stats: 1
4782+
locks_mode: 1
4783+
replication: 1
4784+
replication_slots: 1
4785+
settings: 1
4786+
sproc_stats: 1
4787+
table_io_stats: 1
4788+
table_stats: 1
4789+
wait_events: 1
4790+
wal: 1
4791+
pg_stat_activity: 1
4792+
pg_replication: 1
4793+
pg_stat_wal_receiver: 1
4794+
pg_archiver: 1
4795+
pg_postmaster: 1
4796+
pg_stat_user_tables: 1
4797+
pg_statio_user_tables: 1
4798+
pg_stat_user_indexes: 1
4799+
pg_statio_user_indexes: 1
4800+
pg_indexes_with_size: 1
4801+
pg_stat_statements: 1
4802+
pg_stat_kcache: 1
4803+
pg_total_relation_size: 1
4804+
pg_blocked: 1
4805+
pg_oldest_blocked: 1
4806+
pg_slow: 1
4807+
pg_long_running_transactions: 1
4808+
pg_stuck_idle_in_transaction: 1
4809+
pg_txid: 1
4810+
pg_database_wraparound: 1
4811+
pg_xlog_position: 1
4812+
pg_replication_slots: 1
4813+
pg_stat_ssl: 1
4814+
pg_integer_capacity: 1
4815+
pg_wait_sampling: 1
4816+
pg_wait_sampling_agg: 1
4817+
pg_stat_activity_autovacuum: 1
4818+
pg_stat_activity_autovacuum_active: 1
4819+
pg_gin_index: 1

0 commit comments

Comments
 (0)