使用此Helm图表记录Postgres可获得很好的结果https://github.com/elastic/helm-charts/tree/master/metricbeat
不幸的是,它正在记录我们所有的数据库,而不仅仅是生产数据库。有人可以推荐如何将其限制为单个数据库吗?我怀疑如果我限制用户从PSQL访问数据库的权限,它只会向我显示错误消息,而不是实际限制它。
以下用于头盔的values.yaml:
metricbeatConfig:
metricbeat.yml: |
system:
hostfs: /hostfs
reload.enabled: true
metricbeat.modules:
- module: postgresql
enabled: true
metricsets:
- database
hosts: ['postgres://USER:[email protected]:5432/DATABASE_NAME']
output.elasticsearch:
hosts: '${ELASTICSEARCH_HOSTS:elasticsearch-master:9200}'
从documentation中指出,配置postgresql数据库指标集将收集“有关每个PostgreSQL数据库的统计信息”。
一种选择是在事件中基于事件的主机/主机名删除事件,仅允许所需的数据库统计信息通过。参见https://www.elastic.co/guide/en/beats/metricbeat/current/drop-event.html