tweak logging from telegraf
This commit is contained in:
@@ -83,11 +83,11 @@
|
||||
name_override = "borgmatic_split"
|
||||
|
||||
###############################################################################
|
||||
# DATABASE
|
||||
# DATABASES
|
||||
###############################################################################
|
||||
|
||||
[[inputs.postgresql_extensible]]
|
||||
address = "host=${DATABASE_HOST} port=${DATABASE_PORT} user=${DATABASE_USER} password=${DATABASE_PASS} dbname=${DATABASE_NAME} sslmode=disable"
|
||||
address = "host=host port=11111 user=postgres password=postgres dbname=postgres sslmode=disable"
|
||||
interval = "1m"
|
||||
|
||||
[[inputs.postgresql_extensible.query]]
|
||||
@@ -95,10 +95,9 @@
|
||||
SELECT
|
||||
datname,
|
||||
pg_database_size(datname) AS size_bytes
|
||||
FROM pg_database WHERE datname NOT IN ('template0', 'template1')
|
||||
FROM pg_database WHERE datname IN ('dagster', 'gitea', 'teslamate')
|
||||
"""
|
||||
withdbname = true
|
||||
measurement = "postgresql_database_size"
|
||||
measurement = "postgres_db_size"
|
||||
|
||||
[[inputs.postgresql_extensible.query]]
|
||||
sqlquery = """
|
||||
@@ -109,8 +108,31 @@
|
||||
FROM pg_tables
|
||||
WHERE schemaname NOT IN ('pg_catalog', 'information_schema') AND schemaname NOT LIKE '_timescaledb_%'
|
||||
"""
|
||||
withdbname = false
|
||||
measurement = "postgresql_table_size"
|
||||
measurement = "postgres_table_size"
|
||||
|
||||
[[inputs.postgresql_extensible]]
|
||||
address = "host=${DATABASE_HOST} port=${DATABASE_PORT} user=${DATABASE_USER} password=${DATABASE_PASS} dbname=${DATABASE_NAME} sslmode=disable"
|
||||
interval = "1m"
|
||||
|
||||
[[inputs.postgresql_extensible.query]]
|
||||
sqlquery = """
|
||||
SELECT
|
||||
datname,
|
||||
pg_database_size(datname) AS size_bytes
|
||||
FROM pg_database WHERE datname IN ('homeassistant', 'fluentbit', 'telegraf')
|
||||
"""
|
||||
measurement = "postgres_db_size"
|
||||
|
||||
[[inputs.postgresql_extensible.query]]
|
||||
sqlquery = """
|
||||
SELECT
|
||||
schemaname AS schema_name,
|
||||
tablename AS table_name,
|
||||
pg_total_relation_size(schemaname || '.' || tablename) AS size_bytes
|
||||
FROM pg_tables
|
||||
WHERE schemaname NOT IN ('pg_catalog', 'information_schema') AND schemaname NOT LIKE '_timescaledb_%'
|
||||
"""
|
||||
measurement = "postgres_table_size"
|
||||
|
||||
###############################################################################
|
||||
# OUTPUTS
|
||||
@@ -136,6 +158,7 @@
|
||||
[[outputs.loki]]
|
||||
domain = "http://host:3100"
|
||||
timeout = "10s"
|
||||
# TODO: configure which metrics to include
|
||||
|
||||
[[outputs.mqtt]]
|
||||
servers = ["tcp://host:1883"]
|
||||
@@ -146,3 +169,4 @@
|
||||
retain = false
|
||||
client_id = "telegraf"
|
||||
data_format = "json"
|
||||
# TODO: configure which metrics to include
|
||||
|
||||
Reference in New Issue
Block a user