-
Notifications
You must be signed in to change notification settings - Fork 31
/
postgresql-config.yml.k8s_sample
78 lines (74 loc) · 3.76 KB
/
postgresql-config.yml.k8s_sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
postgresql-config.yml: |
---
# Run auto discovery to find pods with label "app=postgresql"
# https://docs.newrelic.com/docs/integrations/host-integrations/installation/container-auto-discovery
discovery:
command:
# Use the following optional arguments:
# --namespaces: Comma separated list of namespaces to discover pods on
# --tls: Use secure (TLS) connection
# --port: Port used to connect to the kubelet. Default is 10255
exec: /var/db/newrelic-infra/nri-discovery-kubernetes
match:
label.app: postgresql
integrations:
- name: nri-postgresql
env:
USERNAME: <postgres>
PASSWORD: <pass>
# Using the discovered IP as the host address
HOSTNAME: ${discovery.ip}
# The database to connect to on the postgres instance. Defaults to postgres.
# DATABASE: postgres
# The port of the postgres instance. If PgBouncer is being used,
# use the port it is running on. Defaults to 5432
PORT: 5432
# Collection List can be either a JSON array or a JSON object.
#
# If it is a JSON array, it will be interpreted as a list of database names to
# collect all related metrics from. This will collect metrics for each database
# specified, as well as all tables and indexes that belong to that database.
# Example:
# COLLECTION_LIST: '["postgres"]'
#
# If it is a JSON object, you can more finely tune the entities that are collected.
# Only the entities that are specified in the object will be collected. No automatic
# discovery will be performed.
# The levels of JSON are database name -> schema name -> table name -> index name
# Example:
# collection_list: '{"postgres":{"public":{"pg_table1":["pg_index1","pg_index2"],"pg_table2":[]}}}'
COLLECTION_LIST: '["postgres"]'
# JSON array of database names that will be ignored for metrics collection.
# Typically useful for cases where COLLECTION_LIST is set to 'ALL' and some databases need to be ignored.
# Defaults to empty '[]'.
# Example:
# COLLECTION_IGNORE_DATABASE_LIST: '["azure_maintenance","azure_sys"]'
#
# COLLECTION_IGNORE_DATABASE_LIST: '[]'
# JSON array of table names that will be ignored for metrics collection.
# Defaults to empty '[]'.
# Example:
# COLLECTION_IGNORE_TABLE_LIST: '["table1","table2"]'
# True if database lock metrics should be collected
# Note: requires that the `tablefunc` extension be installed on the public schema
# of the database where lock metrics will be collected.
COLLECT_DB_LOCK_METRICS: false
ENABLE_SSL: true
# True if the SSL certificate should be trusted without validating.
# Setting this to true may open up the monitoring service to MITM attacks.
# Defaults to false.
TRUST_SERVER_CERTIFICATE: false
SSL_ROOT_CERT_LOCATION: /etc/newrelic-infra/root_cert.crt
SSL_CERT_LOCATION: /etc/newrelic-infra/postgresql.crt
SSL_KEY_LOCATION: /etc/newrelic-infra/postgresql.key
TIMEOUT: 10
CUSTOM_METRICS_QUERY: >-
select
'rows_inserted' as "metric_name",
'delta' as "metric_type",
sd.tup_inserted as "metric_value",
sd.datid as "database_id"
from pg_stat_database sd;
labels:
env: production
role: postgresql