tweak logging from telegraf
This commit is contained in:
@@ -83,11 +83,11 @@
|
|||||||
name_override = "borgmatic_split"
|
name_override = "borgmatic_split"
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# DATABASE
|
# DATABASES
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
[[inputs.postgresql_extensible]]
|
[[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"
|
interval = "1m"
|
||||||
|
|
||||||
[[inputs.postgresql_extensible.query]]
|
[[inputs.postgresql_extensible.query]]
|
||||||
@@ -95,10 +95,9 @@
|
|||||||
SELECT
|
SELECT
|
||||||
datname,
|
datname,
|
||||||
pg_database_size(datname) AS size_bytes
|
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 = "postgres_db_size"
|
||||||
measurement = "postgresql_database_size"
|
|
||||||
|
|
||||||
[[inputs.postgresql_extensible.query]]
|
[[inputs.postgresql_extensible.query]]
|
||||||
sqlquery = """
|
sqlquery = """
|
||||||
@@ -109,8 +108,31 @@
|
|||||||
FROM pg_tables
|
FROM pg_tables
|
||||||
WHERE schemaname NOT IN ('pg_catalog', 'information_schema') AND schemaname NOT LIKE '_timescaledb_%'
|
WHERE schemaname NOT IN ('pg_catalog', 'information_schema') AND schemaname NOT LIKE '_timescaledb_%'
|
||||||
"""
|
"""
|
||||||
withdbname = false
|
measurement = "postgres_table_size"
|
||||||
measurement = "postgresql_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
|
# OUTPUTS
|
||||||
@@ -136,6 +158,7 @@
|
|||||||
[[outputs.loki]]
|
[[outputs.loki]]
|
||||||
domain = "http://host:3100"
|
domain = "http://host:3100"
|
||||||
timeout = "10s"
|
timeout = "10s"
|
||||||
|
# TODO: configure which metrics to include
|
||||||
|
|
||||||
[[outputs.mqtt]]
|
[[outputs.mqtt]]
|
||||||
servers = ["tcp://host:1883"]
|
servers = ["tcp://host:1883"]
|
||||||
@@ -146,3 +169,4 @@
|
|||||||
retain = false
|
retain = false
|
||||||
client_id = "telegraf"
|
client_id = "telegraf"
|
||||||
data_format = "json"
|
data_format = "json"
|
||||||
|
# TODO: configure which metrics to include
|
||||||
|
|||||||
Reference in New Issue
Block a user