-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathvector.yaml
262 lines (235 loc) · 5.35 KB
/
vector.yaml
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
acknowledgements:
enabled: true
enrichment_tables:
sdk_map:
type: file
file:
path: /etc/vector/config/sdk_map.csv
encoding:
type: csv
schema:
publishable_key: string
merchant_id: string
api:
enabled: true
address: 0.0.0.0:8686
sources:
kafka_tx_events:
type: kafka
bootstrap_servers: kafka0:29092
group_id: sessionizer
topics:
- hyperswitch-payment-attempt-events
- hyperswitch-payment-intent-events
- hyperswitch-refund-events
- hyperswitch-dispute-events
decoding:
codec: json
sessionized_kafka_tx_events:
type: kafka
bootstrap_servers: kafka0:29092
group_id: sessionizer
topics:
- ^sessionizer
decoding:
codec: json
app_logs:
type: docker_logs
include_labels:
- "logs=promtail"
vector_metrics:
type: internal_metrics
node_metrics:
type: host_metrics
sdk_source:
type: http_server
address: 0.0.0.0:3103
encoding: json
transforms:
events_create_ts:
inputs:
- kafka_tx_events
source: |-
.timestamp = from_unix_timestamp(.created_at, unit: "seconds") ?? now()
."@timestamp" = from_unix_timestamp(.created_at, unit: "seconds") ?? now()
type: remap
plus_1_events:
type: filter
inputs:
- events_create_ts
- sessionized_events_create_ts
condition: ".sign_flag == 1"
hs_server_logs:
type: filter
inputs:
- app_logs
condition: '.labels."com.docker.compose.service" == "hyperswitch-server"'
parsed_hs_server_logs:
type: remap
inputs:
- app_logs
source: |-
.message = parse_json!(.message)
sessionized_events_create_ts:
type: remap
inputs:
- sessionized_kafka_tx_events
source: |-
.timestamp = from_unix_timestamp(.created_at, unit: "milliseconds") ?? now()
."@timestamp" = from_unix_timestamp(.created_at, unit: "milliseconds") ?? now()
sdk_transformed:
type: throttle
inputs:
- sdk_source
key_field: "{{ .payment_id }}{{ .merchant_id }}"
threshold: 1000
window_secs: 60
amend_sdk_logs:
type: remap
inputs:
- sdk_transformed
source: |
.before_transform = now()
merchant_id = .merchant_id
row = get_enrichment_table_record!("sdk_map", { "publishable_key" : merchant_id }, case_sensitive: true)
.merchant_id = row.merchant_id
.after_transform = now()
sinks:
opensearch_events_1:
type: elasticsearch
inputs:
- plus_1_events
endpoints:
- "https://opensearch:9200"
id_key: message_key
api_version: v7
tls:
verify_certificate: false
verify_hostname: false
auth:
strategy: basic
user: admin
password: 0penS3arc#
encoding:
except_fields:
- message_key
- offset
- partition
- topic
- clickhouse_database
- last_synced
- sign_flag
bulk:
index: "vector-{{ .topic }}"
opensearch_events_2:
type: elasticsearch
inputs:
- plus_1_events
endpoints:
- "https://opensearch:9200"
id_key: message_key
api_version: v7
tls:
verify_certificate: false
verify_hostname: false
auth:
strategy: basic
user: admin
password: 0penS3arc#
encoding:
except_fields:
- message_key
- offset
- partition
- topic
- clickhouse_database
- last_synced
- sign_flag
bulk:
# Add a date suffixed index for better grouping
index: "vector-{{ .topic }}-%Y-%m-%d"
opensearch_events_3:
type: elasticsearch
inputs:
- plus_1_events
endpoints:
- "https://opensearch:9200"
id_key: message_key
api_version: v7
tls:
verify_certificate: false
verify_hostname: false
auth:
strategy: basic
user: admin
password: 0penS3arc#
encoding:
except_fields:
- message_key
- offset
- partition
- topic
- clickhouse_database
- last_synced
- sign_flag
bulk:
index: "{{ .topic }}"
opensearch_logs:
type: elasticsearch
inputs:
- parsed_hs_server_logs
endpoints:
- "https://opensearch:9200"
api_version: v7
tls:
verify_certificate: false
verify_hostname: false
auth:
strategy: basic
user: admin
password: 0penS3arc#
bulk:
# Add a date suffixed index for better grouping
# index: "vector-{{ .topic }}-%Y-%m-%d"
index: "logs-{{ .container_name }}-%Y-%m-%d"
log_events:
type: loki
inputs:
- kafka_tx_events
- sessionized_kafka_tx_events
endpoint: http://loki:3100
labels:
source: vector
topic: "{{ .topic }}"
job: kafka
encoding:
codec: json
log_app_loki:
type: loki
inputs:
- parsed_hs_server_logs
endpoint: http://loki:3100
labels:
source: vector
job: app_logs
container: "{{ .container_name }}"
stream: "{{ .stream }}"
encoding:
codec: json
metrics:
type: prometheus_exporter
inputs:
- vector_metrics
- node_metrics
sdk_sink:
type: kafka
encoding:
codec: json
except_fields:
- "path"
- "source_type"
inputs:
- "amend_sdk_logs"
bootstrap_servers: kafka0:29092
topic: hyper-sdk-logs
key_field: ".merchant_id"