generated from xmidt-org/.go-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
caduceator.yaml
411 lines (353 loc) · 14.6 KB
/
caduceator.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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
## SPDX-FileCopyrightText: 2020 Comcast Cable Communications Management, LLC
## SPDX-License-Identifier: Apache-2.0
---
# The unique fully-qualified-domain-name of the server. It is provided to
# the X-Caduceator-Server header for showing what server fulfilled the request
# sent.
# (Optional)
server: "caduceator-instance-123.example.com"
########################################
# Labeling/Tracing via HTTP Headers Configuration
########################################
# Provides this build number to the X-Caduceator-Build header for
# showing machine version information. The build number SHOULD
# match the scheme `version-build` but there is not a strict requirement.
# (Optional)
build:
# Provides the region information to the X-Caduceator-Region header
# for showing what region this machine is located in. The region
# is arbitrary and optional.
# (Optional)
region:
# Provides the flavor information to the X-Caduceator-Flavor header
# for showing what flavor this machine is associated with. The flavor
# is arbitrary and optional.
# (Optional)
flavor:
########################################
# Primary Endpoint Configuration
########################################
# primary defines the details needed for the primary endpoint. The
# primary endpoint accepts requests for events for a specific device id.
primary:
# address provides the port number for the endpoint to bind to.
# ":443" is ideal, but may require some special handling due to it being
# a reserved (by the kernel) port.
address: ":5000"
# HTTPS/TLS
#
# certificateFile provides the public key and CA chain in PEM format if
# TLS is used. Note: the certificate needs to match the fqdn for clients
# to accept without issue.
#
# keyFile provides the private key that matches the certificateFile
# (Optional)
# certificateFile: "/etc/gungnir/public.pem"
# keyFile: "/etc/gungnir/private.pem"
########################################
# Health Endpoint Configuration
########################################
# health defines the details needed for the health check endpoint. The
# health check endpoint is generally used by services (like AWS Route53
# or consul) to determine if this particular machine is healthy or not.
health:
# port provides the port number for the endpoint to bind to.
# ":80" is ideal, but may require some special handling due to it being
# a reserved (by the kernel) port.
port: ":5001"
# endpoint provides the endpoint that will provide the health check
# information.
endpoint: "/health"
########################################
# Debugging/Pprof Configuration
########################################
# pprof defines the details needed for the pprof debug endpoint.
# (Optional)
pprof:
# address provides the port number for the endpoint to bind to.
address: ":5002"
########################################
# Metrics Configuration
########################################
# metric defines the details needed for the prometheus metrics endpoint
# (Optional)
metric:
# address provides the port number for the endpoint to bind to. Port 9389
# was chosen because it does not conflict with any of the other prometheus
# metrics or other machines in the xmidt cluster. You may use any port you
# wish.
address: ":5003"
# metricsOptions provides the details needed to configure the prometheus
# metric data. Metrics generally have the form:
#
# {namespace}_{subsystem}_{metric}
#
# so if you use the suggested value below, your metrics are prefixed like
# this:
#
# xmidt_caduceator_{metric}
#
# (Optional)
metricsOptions:
# namespace is the namespace of the metrics provided
# (Optional)
namespace: xmidt
# subsystem is the subsystem of the metrics provided
# (Optional)
subsystem: caduceator
########################################
# Logging Related Configuration
########################################
# log configures the logging subsystem details
log:
# file is the name of the most recent log file. If set to "stdout" this
# will log to os.Stdout.
# (Optional) defaults to os.TempDir()
#file: "/var/log/caduceator/caduceator.log"
file: "stdout"
# level is the logging level to use - INFO, DEBUG, WARN, ERROR
# (Optional) defaults to ERROR
level: "DEBUG"
# maxsize is the maximum file size in MB
# (Optional) defaults to max 100MB
maxsize: 50
# maxage is the maximum number of days to retain old log files
# (Optional) defaults to ignore age limit (0)
maxage: 30
# maxbackups is the maximum number of old log files to retain
# (Optional) defaults to retain all (0)
maxbackups: 10
# json is a flag indicating whether JSON logging output should be used.
# (Optional) defaults to false
json: true
########################################
# Vegeta Related Configuration
########################################
# vegeta configures how often and how long to keep attacking caduceus
vegetaConfig:
# frequency is the number of events that will be sent to Caduceus' notify endpoint every period.
frequency: 1000
# period is how often events will be sent to Caduceus
# if frequency is set to 100 and period is set to 1s, then Caduceator will be sending
# 100 events per second to Caduceus
period: "5s"
# connections is the number of idle open connections per target host
connections: 500
# duration is how long (in minutes) vegeta will be sending events to Caduceus
# duration of 0 means vegeta will infinitely keep on attacking caduceus until stopped
duration: 0
# maxRoutines is used to limit how long to send events until the number of times a cutoff is reached
# maxRoutines of 0 means that we will get infinite cutoffs
maxRoutines: 0
# url to send events to
postURL: "http://caduceus:6000/api/v3/notify"
# sleepTime is used to slow down the ingestion of events from a consumer's perspective
# it is the duration of time to sleep before sending a status back to Caduceus upon receiving events
# a longer sleepTime will result in creating a slower consumer.
sleepTime: "5s"
# client timeout in seconds
clientTimeout: "5s"
# messages allows for a list of custom wrp messages to be sent
messages:
# fixedCurrentTime dictates whether to use the time from the start of the application or
# time.Now when calculating the timestamps for the message. If false, it uses time.Now.
fixedCurrentTime: false
# messageContents is a list of wrp message details that dictates the content of the messages being sent. These messages are sent
# all at once, meaning that if there are 4 messages in the list and the attacker
# attacks at a frequency of 4 per second, 16 messages would be sent per second. For accurate performance testing of caduceus,
# it is best to only have one message in this list.
messageContents:
# wrp is the custom wrp message
- wrp:
source: "source"
destination: "destination"
metadata:
- "some-key": "some-value"
- "another key": "another value"
transactionUUID: "uuid-string"
# # payload contains key value pairs that will be marshaled into a json and converted into a byte string
payload:
- "payloadKey": "payloadVal"
# # bootTimeOffset is a duration used in creating the boot-time time-stamp. This duration
# # is added to the current time.
bootTimeOffset: "-2h"
# # birthdateOffset is a duration used in creating the birthdate time-stamp. This duration
# # is added to the current time.
birthdateOffset: "-1h"
# simulates talaria rehash
vegetaRehash:
routines: 0
period: "1s"
frequency: 500
connections: 500
duration: 0
wrpMessageDest: "event:device-status/mac:112233445566/offline"
# vegeta config to simulate a rehash
# vegetaRehash:
# # routines is the number of rehashes Caduceus will recieve
# # if routines is set to 0, no rehashes will take place
# routines: 0
# # frequency is the number of additional events that will be sent to the
# # same Caduceus' notify endpoint every period as a rehash.
# frequency:
# # period is how often a rehash will occur in Caduceus
# period:
# # connections is the number of idle open connections per target host
# connections:
# # duration is how long (in minutes) vegeta will be sending events to Caduceus during a rehash period
# # duration of 0 means vegeta will infinitely keep on attacking caduceus until stopped
# duration:
# # destination of where to send wrpMessage for rehash events
# wrpMessageDest:
# The following is an example Caduceator vegeta configuration to load test Caduceus
# of a slow consumer by sending 1000 events per second and only wanting Caduceator
# to be cutoff by Caduceus 5 times.
# vegetaConfig:
# frequency: 1000,
# period: "1s",
# connections: 500,
# duration : 0,
# maxRoutines: 5,
# sleepTime: "45s",
# clientTimeout: "5s",
# wrpMessageDest: "event:device-status/mac:112233445566/offline"
# By adding the following rehash configuration to vegetaConfig,
# it will simulate a 2 rehash events in Caduceus by sending an additional 500 events
# a second every 10 minutes. If routine is set to 0 then no rehash event will occur in Caduceus.
# vegetaConfig:
# frequency: 1000,
# period: "1s",
# connections: 500,
# duration : 0,
# maxRoutines: 5,
# sleepTime: "45s",
# clientTimeout: "5s",
# wrpMessageDest: "event:device-status/mac:112233445566/offline"
# vegetaRehash:
# routines: 2,
# frequency: 500,
# period: "1s",
# connections: 500,
# duration: 0,
# wrpMessageDest: "event:device-status/mac:112233445566/offline"
########################################
# Prometheus Related Configuration
########################################
# prometheusConfig defines details realted to querying metrics from prometheus.
# If the below values are all provided, a request is made to the
# URL to get the metric from the expression.
prometheusConfig:
# queryURL is the server where to query metrics
queryURL: "http://prometheus:9090/api/v1/query"
# queryExpression is the expression used to get metricss
queryExpression: "sum(xmidt_caduceus_outgoing_queue_depths) by (url)"
# metricsURL is used to confirm the values from metrics that are received
# is from the endpoint in which events are sent to
metricsURL: "http://caduceator:5000/events"
# authorization for prometheus server
auth: ""
# timeout for attempt to login
timeout:
########################################
# Authorization Related Configuration
########################################
# secret contains information for finding the secret on incoming requests. If
# both header and webhook secret are empty, no authentication is done on
# incoming requests to Svalinn. Otherwise, the value at the header provided
# should hold a sha1 hash of the request body. It should be in the format:
#
# Sha1<delimiter><hash>
#
# (Optional)
secret:
# header provides the header key where the hash is expected.
# (Optional)
header: "X-Webpa-Signature"
# delimiter provides the string that is expected between "Sha1" and the hash.
# (Optional)
delimiter: "="
########################################
# Webhook Registration Related Configuration
########################################
# webhook provides the information needed to register to a webhook. If the
# urls and event regex aren't empty and the interval is greater than 0,
# registration occurs.
# (Optional)
webhook:
# registrationInterval provides the time to wait between each registration to
# the webhook. If this is set to 0, no registration is done.
# (Optional)
registrationInterval: "3m"
# timeout provides the length of time the request should wait before timing
# out
timeout: "5s"
# registrationURL provides the place to register the webhook.
registrationURL: "http://caduceus:6000/hook"
# number of webhooks we want registering at every registrationInterval
webhookCount: 1
# request provides the information passed in the webhook registration request.
request:
# config provides configuration values for the requests to the webhook
# receiver.
webhookConfig:
# url provides the server the webhook should send the events to. If this
# value isn't set, no registration happens.
url: "http://caduceator:5000/events"
failureURL: "http://caduceator:5000/cutoff"
# contentType provides the content type Svalinn expects from the requests
# it receives.
# (Optional) defaults to "wrp"
#contentType: "wrp"
# secret provides the key for hashing the messages the webhook sends.
# If this is empty, no authentication is done later for incoming requests
# to Svalinn.
# (Optional)
secret: "secret1234"
# maxRetryCount is the number of times to retry on a failure.
# (Optional)
maxRetryCount:
# alternativeURLs provides endpoints to round robin through on a failure
# to send an event. This is only used if the maxRetryCount is greater
# than 0.
# (Optional)
#AlternativeURLs: []
# events provides a list of regular expressions that tells the webhook
# which endpoints to send to Svalinn. If the destination of an event
# matches a regular expression in this list, it is sent to Svalinn
events: "device-status.*"
# matcher provides regular expressions to match against the event source.
# (Optional) default is [".*"]
# matcher:
# deviceID: [".*"]
# the below configuration values provide a way to add an Authorization header
# to the request to the webhook. If both basic and sat contain empty values,
# no header is sent. sat takes priority over basic if both are set.
# basic provides a way to use Basic Authorization when registering to a
# webhook. If this value is provided and sat isn't, the following header is
# added to the registration request:
#
# Authorization Basic {basic}
#
# (Optional)
basic: "Basic dXNlcjpwYXNz"
# jwt provides a way to use Bearer Authorization when registering to a
# webhook. If the below values are all provided, a request is made to the
# URL to get the token to be used in the registration request. The
# header would look like:
#
# Authorization Bearer {token}
#
# (Optional)
# jwt:
# # requestHeaders are added to the request for the token.
# # (Optional)
# requestHeaders:
# # - "":""
# # authURL is the URL to access for the token.
# authURL: ""
# # timeout is how long the request to get the token will take before
# # timing out.
# timeout: "1m"
# # buffer is the length of time before a token expires to get a new token.
# # (Optional)
# buffer: "1m"