-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose-swarmstack.yml
53 lines (46 loc) · 1.66 KB
/
docker-compose-swarmstack.yml
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
version: '3.5'
networks:
default:
external: true
name: swarmstack_net
configs:
postgres_exporter_config:
file: ./queries.yaml
#postgres92_exporter_config:
# file: ./queries92.yaml
services:
# Example for PostgreSQL 9.4 or later host
postgres-exporter-pgserver94:
image: wrouesnel/postgres_exporter:latest
configs:
- source: postgres_exporter_config
target: /etc/postgres_exporter/queries.yaml
deploy:
# recommend static scrape target rather than swarm-discovery via labels below so that you can scrape less often
#labels:
# prometheus.enable: "true"
# prometheus.port: "9187"
# prometheus.path: "/metrics"
mode: replicated
replicas: 1
environment:
- DATA_SOURCE_NAME=postgresql://postgres@pgserver94.example.com:5432/postgres?sslmode=disable
- PG_EXPORTER_EXTEND_QUERY_PATH=/etc/postgres_exporter/queries.yaml
# Example for older PostgreSQL 9.2
#postgres-exporter-pgserver92:
# image: wrouesnel/postgres_exporter:latest
# configs:
# - source: postgres92_exporter_config
# target: /etc/postgres_exporter/queries.yaml
# deploy:
# # recommend static scrape target rather than swarm-discovery via labels below so that you can scrape less often
# #labels:
# # prometheus.enable: "true"
# # prometheus.port: "9187"
# # prometheus.path: "/metrics"
# mode: replicated
# replicas: 1
# environment:
# - DATA_SOURCE_NAME=postgresql://postgres@pgserver92.example.com:5432/postgres?sslmode=disable
# - PG_EXPORTER_EXTEND_QUERY_PATH=/etc/postgres_exporter/queries.yaml
# - PG_EXPORTER_DISABLE_DEFAULT_METRICS=true