-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathconfig_template.yaml
More file actions
176 lines (172 loc) · 11.5 KB
/
Copy pathconfig_template.yaml
File metadata and controls
176 lines (172 loc) · 11.5 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
logging:
level: debug # log level for the application. One of trace, debug, info, warn, error, fatal, panic. Defaults to debug.
format:
type: console # log output format. One of console or json. Defaults to console.
no_color: false # disable ANSI color codes in console log output. Only valid when type is console. Defaults to false.
instrumentation:
metrics:
endpoint: "0.0.0.0:4317"
collection_interval: 60 # collection interval for metrics in seconds. Defaults to 60s
traces:
endpoint: "0.0.0.0:4317"
sample_ratio: 0.5 # ratio of traces that will be sampled. Must be between 0.0-1.0, where 0 is no traces sampled, and 1 is all traces sampled.
health:
enabled: false # whether to expose the /health (liveness), /ready (readiness), and /status (pipeline phase) HTTP endpoints. Only honoured by the run and snapshot commands. Defaults to false.
address: "localhost:9910" # address the health server binds to. Defaults to localhost:9910.
source:
postgres:
url: "postgresql://user:password@localhost:5432/mydatabase"
mode: snapshot_and_replication # options are replication, snapshot or snapshot_and_replication
snapshot: # when mode is snapshot or snapshot_and_replication
mode: full # options are data_and, schema or data
tables: ["test", "test_schema.Test", "another_schema.*"] # tables to snapshot, can be a list of table names or a pattern
excluded_tables: ["test_schema.Test"] # tables to exclude for snapshot, wildcards are not supported
recorder:
repeatable_snapshots: true # whether to repeat snapshots that have already been taken. Defaults to false
postgres_url: "postgresql://user:password@localhost:5432/mytargetdatabase" # URL of the database where the snapshot status is recorded
snapshot_workers: 4 # number of schemas to be snapshotted in parallel. Defaults to 1
data: # when mode is full or data
schema_workers: 4 # number of schema tables to be snapshotted in parallel. Defaults to 4
table_workers: 4 # number of workers to snapshot a table in parallel. Defaults to 4
batch_bytes: 83886080 # bytes to read per batch (defaults to 80MiB)
schema: # when mode is full or schema
mode: pgdump_pgrestore # options are pgdump_pgrestore or schemalog
pgdump_pgrestore:
clean_target_db: true # whether to clean the target database before restoring. Defaults to false
create_target_db: true # whether to create the database on the target postgres. Defaults to false
include_global_db_objects: true # whether to include database global objects, such as extensions or triggers, on the schema snapshot. Defaults to false
no_owner: false # whether to remove ownership commands from the dump. Defaults to false
no_privileges: false # whether to prevent dumping privilege commands (grant/revoke). Defaults to false
role: postgres # role name to be used to create the dump
roles_snapshot_mode: # enabled by default. Can be set to disabled to disable roles snapshotting, or can be set to no_passwords to exclude role passwords
exclude_security_labels: ["anon"] # list of providers whose security labels will be excluded from the snapshot. Wildcard supported.
refresh_materialized_views: false # whether to refresh materialized views (REFRESH MATERIALIZED VIEW ... WITH DATA) after the table data has been restored. Defaults to false
dump_file: pg_dump.sql # name of the file where the contents of the schema pg_dump command and output will be written for debugging purposes.
replication: # when mode is replication or snapshot_and_replication
replication_slot: "pgstream_mydatabase_slot"
plugin:
include_xids: false # whether to include transaction IDs in the replication stream events. Defaults to false.
kafka:
servers: ["localhost:9092"]
topic:
name: "mytopic"
consumer_group:
id: "mygroup" # id for the kafka consumer group. Defaults to pgstream-consumer-group
start_offset: "earliest" # options are earliest or latest. Defaults to earliest.
tls:
ca_cert: "/path/to/ca.crt" # path to CA certificate
client_cert: "/path/to/client.crt" # path to client certificate
client_key: "/path/to/client.key" # path to client key
backoff: # one of exponential or constant
exponential:
max_retries: 5 # maximum number of retries
initial_interval: 1000 # initial interval in milliseconds
max_interval: 60000 # maximum interval in milliseconds
max_elapsed_time: 0 # maximum total retry time in milliseconds (0 = unlimited)
constant:
max_retries: 5 # maximum number of retries
interval: 1000 # interval in milliseconds
target:
postgres:
url: "postgresql://user:password@localhost:5432/mytargetdatabase"
batch:
timeout: 1000 # batch timeout in milliseconds. Defaults to 30s
size: 100 # number of messages in a batch. Defaults to 20000
max_bytes: 1572864 # max size of batch in bytes (1.5MiB). Defaults to 1.5MiB without bulk enabled, 80MiB with bulk ingest.
max_queue_bytes: 104857600 # max size of memory guard queue in bytes (100MiB). Defaults to 100MiB
ignore_send_errors: false # if true, log and ignore errors during batch sending. Warning: can result in consistency errors.
auto_tune:
enabled: true # whether to enable auto tuning of batch bytes. Defaults to false
min_batch_bytes: 1048576 # minimum batch size in bytes (1MB). Defaults to 1MB
max_batch_bytes: 52428800 # maximum batch size in bytes (50MB). Defaults to 50MB
convergence_threshold: 0.01 # convergence threshold as a fraction of max batch size. Defaults to 0.01
schema_log_store_url: "postgresql://user:password@localhost:5432/mydatabase" # url to the postgres database where the schema log is stored to be used when performing schema change diffs
disable_triggers: false # whether to disable triggers on the target database. Defaults to false
on_conflict_action: "nothing" # options are update, nothing or error. Defaults to error
bulk_ingest:
enabled: true # whether to enable bulk ingest on the target postgres, using COPY FROM (supported for insert only workloads)
copy_workers: 8 # number of concurrent COPY streams per table when bulk ingesting. Defaults to 8. Only applies when bulk_ingest.enabled is true.
kafka:
servers: ["localhost:9092"]
topic:
name: "mytopic" # name of the Kafka topic
partitions: 1 # number of partitions for the topic. Defaults to 1
replication_factor: 1 # replication factor for the topic. Defaults to 1
auto_create: true # whether to automatically create the topic if it doesn't exist. Defaults to false
tls:
ca_cert: "/path/to/ca.crt" # path to CA certificate
client_cert: "/path/to/client.crt" # path to client certificate
client_key: "/path/to/client.key" # path to client key
batch:
timeout: 1000 # batch timeout in milliseconds. Defaults to 1s
size: 100 # number of messages in a batch. Defaults to 100
max_bytes: 1572864 # max size of batch in bytes (1.5MiB). Defaults to 1.5MiB
max_queue_bytes: 104857600 # max size of memory guard queue in bytes (100MiB). Defaults to 100MiB
ignore_send_errors: false # if true, log and ignore errors during batch sending. Warning: can result in consistency errors.
search:
engine: "elasticsearch" # options are elasticsearch or opensearch
url: "http://localhost:9200" # URL of the search engine
hash_doc_ids: false # if true, hash document IDs using SHA256 to avoid exceeding the 512 byte limit
tls: # optional. Only needed when the search target requires HTTPS or a custom CA / mTLS.
ca_cert: "" # path to a PEM-encoded CA certificate. Leave empty to use the system pool.
client_cert: "" # path to a PEM-encoded client certificate (mTLS).
client_key: "" # path to a PEM-encoded client key (mTLS).
insecure_skip_verify: false # if true, skip server certificate verification. Use only against trusted/self-signed clusters in internal networks.
batch:
timeout: 1000 # batch timeout in milliseconds. Defaults to 1s
size: 100 # number of messages in a batch. Defaults to 100
max_bytes: 1572864 # max size of batch in bytes (1.5MiB). Defaults to 1.5MiB
max_queue_bytes: 104857600 # max size of memory guard queue in bytes (100MiB). Defaults to 100MiB
ignore_send_errors: false # if true, log and ignore errors during batch sending. Warning: can result in consistency errors.
backoff:
exponential:
max_retries: 5 # maximum number of retries
initial_interval: 1000 # initial interval in milliseconds
max_interval: 60000 # maximum interval in milliseconds
max_elapsed_time: 0 # maximum total retry time in milliseconds (0 = unlimited)
constant:
max_retries: 5 # maximum number of retries
interval: 1000 # interval in milliseconds
webhooks:
subscriptions:
store:
url: "postgresql://user:password@localhost:5432/mydatabase" # URL of the database where the webhook subscriptions are stored
cache:
enabled: true # whether to enable caching for the subscription store. Defaults to false
refresh_interval: 60 # interval in seconds to refresh the cache
server:
address: "localhost:9090" # address of the subscription server
read_timeout: 60 # read timeout in seconds. Defaults to 5s
write_timeout: 60 # write timeout in seconds. Defaults to 10s
notifier:
worker_count: 4 # number of notifications to be processed in parallel. Defaults to 10
client_timeout: 1000 # timeout for the webhook client in milliseconds. Defaults to 10s
stdout: {} # write WAL events as NDJSON to stdout. Useful for debugging and validating the pipeline without a real target.
modifiers:
injector:
enabled: true # whether to inject pgstream metadata into the WAL events. Defaults to false
schemalog_url: "postgres://postgres:postgres@localhost:5432?sslmode=disable" # URL of the schemalog database, if different from the source database
filter: # one of include_tables or exclude_tables
include_tables: # list of tables for which events should be allowed. Tables should be schema qualified. If no schema is provided, the public schema will be assumed. Wildcards "*" are supported.
- "test"
- "test_schema.test"
- "another_schema.*"
exclude_tables: # list of tables for which events should be skipped. Tables should be schema qualified. If no schema is provided, the public schema will be assumed. Wildcards "*" are supported.
- "excluded_test"
- "excluded_schema.test"
- "another_excluded_schema.*"
sanitize:
strip_null_char_bytes: true # strip null bytes (0x00) from string column values. Defaults to false
transformations:
infer_from_security_labels: false # whether to infer anonymization rules from Postgres `anon` security labels. Requires a live connection to the source database. Defaults to false
dump_inferred_rules: false # if set, dumps the inferred anonymization rules to a file in YAML format for debugging purposes. The file will be named `inferred_anon_transformation_rules.yaml` and will be created in the directory where pgstream is run. Defaults to false
validation_mode: relaxed
table_transformers:
- schema: public
table: test
column_transformers:
name:
name: greenmask_firstname
dynamic_parameters:
gender:
column: sex