Telegraf now collects host filesystem usage ([[inputs.disk]], via a read-only /hostfs mount) and PostgreSQL database + per-table sizes ([[inputs.postgresql_extensible]]) into InfluxDB. Surfaces RIB growth and disk pressure — relevant now that the full-table GoBGP feed has pushed the openbmp DB to ~30 GB. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
98 lines
3.8 KiB
Plaintext
98 lines
3.8 KiB
Plaintext
# Telegraf Configuration for gNMI Streaming Telemetry
|
|
# Collects interface counters and data rates from IOS-XR routers
|
|
|
|
[global_tags]
|
|
|
|
[agent]
|
|
interval = "10s"
|
|
round_interval = true
|
|
metric_batch_size = 1000
|
|
metric_buffer_limit = 10000
|
|
collection_jitter = "0s"
|
|
flush_interval = "10s"
|
|
flush_jitter = "0s"
|
|
precision = "0s"
|
|
|
|
###############################################################################
|
|
# INPUT PLUGINS #
|
|
###############################################################################
|
|
|
|
## gNMI targets — driven by environment variables so the telemetry fleet can
|
|
## scale without editing this file. Set in .env:
|
|
## GNMI_ADDRESSES — quoted, comma-separated host:port list, e.g.
|
|
## GNMI_ADDRESSES="10.0.0.1:57400", "10.0.0.2:57400"
|
|
## GNMI_USERNAME / GNMI_PASSWORD — gNMI credentials (uniform across the fleet)
|
|
## Every target must have gNMI/grpc enabled and be reachable on the gRPC port.
|
|
[[inputs.gnmi]]
|
|
addresses = [ ${GNMI_ADDRESSES} ]
|
|
username = "${GNMI_USERNAME}"
|
|
password = "${GNMI_PASSWORD}"
|
|
|
|
## No TLS (lab environment)
|
|
enable_tls = false
|
|
|
|
## Use json_ietf encoding (supported by IOS-XR 24.3.1)
|
|
encoding = "json_ietf"
|
|
|
|
## Redial in case of failures after
|
|
redial = "10s"
|
|
|
|
## OpenConfig interface counters (bytes, packets, errors, discards)
|
|
[[inputs.gnmi.subscription]]
|
|
name = "interface_counters"
|
|
origin = "openconfig-interfaces"
|
|
path = "/interfaces/interface/state/counters"
|
|
subscription_mode = "sample"
|
|
sample_interval = "10s"
|
|
|
|
## OpenConfig interface state (admin/oper status, description, type)
|
|
[[inputs.gnmi.subscription]]
|
|
name = "interface_state"
|
|
origin = "openconfig-interfaces"
|
|
path = "/interfaces/interface/state"
|
|
subscription_mode = "sample"
|
|
sample_interval = "30s"
|
|
|
|
## Docker container resource metrics — CPU, memory (incl. limit + %), network,
|
|
## and block IO for every obmp-* container. Surfaces resource pressure (e.g. a
|
|
## container approaching its mem_limit) before it OOM-crashes.
|
|
[[inputs.docker]]
|
|
endpoint = "unix:///var/run/docker.sock"
|
|
gather_services = false
|
|
container_name_include = ["obmp-*"]
|
|
perdevice = false
|
|
total = true
|
|
timeout = "10s"
|
|
|
|
## Host filesystem usage — free/used space on the volumes holding the
|
|
## Postgres data, Kafka, InfluxDB and the OpenBMP data root. The host root is
|
|
## bind-mounted read-only at /hostfs and HOST_MOUNT_PREFIX / HOST_PROC (set in
|
|
## docker-compose.yml) point the plugin at the host, not the container.
|
|
[[inputs.disk]]
|
|
interval = "60s"
|
|
ignore_fs = ["tmpfs", "devtmpfs", "devfs", "overlay", "aufs", "squashfs", "ramfs", "nsfs", "iso9660"]
|
|
|
|
## PostgreSQL database + table sizes — tracks RIB growth, which expands
|
|
## sharply once the full-table GoBGP feed is ingesting (~1M routes).
|
|
[[inputs.postgresql_extensible]]
|
|
interval = "60s"
|
|
address = "host=localhost port=5432 user=openbmp password=${POSTGRES_PASSWORD} dbname=openbmp sslmode=disable"
|
|
[[inputs.postgresql_extensible.query]]
|
|
sqlquery = "SELECT datname, pg_database_size(datname) AS bytes FROM pg_database WHERE datname = 'openbmp'"
|
|
measurement = "postgresql_db_size"
|
|
tagvalue = "datname"
|
|
[[inputs.postgresql_extensible.query]]
|
|
sqlquery = "SELECT c.relname AS tablename, pg_total_relation_size(c.oid) AS bytes FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE n.nspname = 'public' AND c.relkind = 'r' ORDER BY 2 DESC LIMIT 20"
|
|
measurement = "postgresql_table_size"
|
|
tagvalue = "tablename"
|
|
|
|
###############################################################################
|
|
# OUTPUT PLUGINS #
|
|
###############################################################################
|
|
|
|
[[outputs.influxdb_v2]]
|
|
urls = ["http://localhost:8086"]
|
|
token = "${INFLUXDB_TOKEN}"
|
|
organization = "openbmp"
|
|
bucket = "telemetry"
|