Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit 1ca9df2

Browse files
committed
remove consumer prefix from parameters and update example configs
1 parent da7f42a commit 1ca9df2

File tree

9 files changed

+308
-125
lines changed

9 files changed

+308
-125
lines changed

docker/docker-chaos/metrictank.ini

+42-18
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,28 @@ partition = 0
178178
enabled = true
179179
# For incoming MetricPoint messages without org-id, assume this org id
180180
org-id = 0
181+
# save interval for consumption lag
182+
lag-collection-interval = 5s
183+
# Maximum number of messages batched in one MessageSet
184+
batch-num-messages = 10000
185+
# Delay in milliseconds to wait for messages in the producer queue to accumulate before constructing message batches (MessageSets) to transmit to brokers
186+
metrics-buffer-max = 100ms
187+
# The number of metrics to buffer in internal and external channels
188+
channel-buffer-size = 1000
189+
# The minimum number of message bytes to fetch in a request
190+
fetch-min = 1
191+
# The maximum amount of time the broker will wait for Consumer.Fetch.Min bytes to become available before it
192+
max-wait = 1s
193+
# Time to wait between attempts to fetch metadata
194+
metadata-backoff-time = 500ms
195+
# Number of retries to fetch metadata in case of failure
196+
metadata-retries = 5
197+
# Maximum time to wait for the broker to reply to metadata queries
198+
metadata-timeout = 10s
199+
# How many outstanding requests a connection is allowed to have before sending on it blocks
200+
net-max-open-requests = 100
201+
# Client group session and failure detection timeout
202+
session-timeout = 10s
181203
# tcp address (may be given multiple times as a comma-separated list)
182204
brokers = kafka:9092
183205
# kafka topic (may be given multiple times as a comma-separated list)
@@ -188,21 +210,6 @@ topics = mdm
188210
offset = oldest
189211
# kafka partitions to consume. use '*' or a comma separated list of id's
190212
partitions = *
191-
# save interval for consumption lag
192-
lag-collection-interval = 5s
193-
# directory to store partition offsets index. supports relative or absolute paths. empty means working dir.
194-
# it will be created (incl parent dirs) if not existing.
195-
data-dir = /var/lib/metrictank
196-
# The number of metrics to buffer in internal and external channels
197-
channel-buffer-size = 1000
198-
# The minimum number of message bytes to fetch in a request
199-
consumer-fetch-min = 1
200-
# The default number of message bytes to fetch in a request
201-
consumer-fetch-default = 32768
202-
# The maximum amount of time the broker will wait for Consumer.Fetch.Min bytes to become available before it
203-
consumer-max-wait = 1s
204-
# How many outstanding requests a connection is allowed to have before sending on it blocks
205-
net-max-open-requests = 100
206213

207214
## basic clustering settings ##
208215
[cluster]
@@ -285,11 +292,28 @@ partition-scheme = bySeries
285292
offset = oldest
286293
# save interval for consumption lag
287294
lag-collection-interval = 5s
295+
# Maximum number of messages batched in one MessageSet
296+
batch-num-messages = 10000
297+
# Delay in milliseconds to wait for messages in the producer queue to accumulate before constructing message batches (MessageSets) to transmit to brokers
298+
metrics-buffer-max = 100ms
299+
# The number of metrics to buffer in internal and external channels
300+
channel-buffer-size = 1000
288301
# Maximum time backlog processing can block during metrictank startup.
289302
backlog-process-timeout = 60s
290-
# directory to store partition offsets index. supports relative or absolute paths. empty means working dir.
291-
# it will be created (incl parent dirs) if not existing.
292-
data-dir = /var/lib/metrictank
303+
# The minimum number of message bytes to fetch in a request
304+
fetch-min = 1
305+
# The maximum amount of time the broker will wait for Consumer.Fetch.Min bytes to become available before it
306+
max-wait = 1s
307+
# Time to wait between attempts to fetch metadata
308+
metadata-backoff-time = 500ms
309+
# Number of retries to fetch metadata in case of failure
310+
metadata-retries = 5
311+
# Maximum time to wait for the broker to reply to metadata queries
312+
metadata-timeout = 10s
313+
# How many outstanding requests a connection is allowed to have before sending on it blocks
314+
net-max-open-requests = 100
315+
# Client group session and failure detection timeout
316+
session-timeout = 10s
293317

294318
### nsq as transport for clustering messages
295319
[nsq-cluster]

docker/docker-cluster/metrictank.ini

+45-18
Original file line numberDiff line numberDiff line change
@@ -178,30 +178,38 @@ partition = 0
178178
enabled = true
179179
# For incoming MetricPoint messages without org-id, assume this org id
180180
org-id = 0
181+
# save interval for consumption lag
182+
lag-collection-interval = 5s
183+
# Maximum number of messages batched in one MessageSet
184+
batch-num-messages = 10000
185+
# Delay in milliseconds to wait for messages in the producer queue to accumulate before constructing message batches (MessageSets) to transmit to brokers
186+
metrics-buffer-max = 100ms
187+
# The number of metrics to buffer in internal and external channels
188+
channel-buffer-size = 1000
189+
# The minimum number of message bytes to fetch in a request
190+
fetch-min = 1
191+
# The maximum amount of time the broker will wait for Consumer.Fetch.Min bytes to become available before it
192+
max-wait = 1s
193+
# Time to wait between attempts to fetch metadata
194+
metadata-backoff-time = 500ms
195+
# Number of retries to fetch metadata in case of failure
196+
metadata-retries = 5
197+
# Maximum time to wait for the broker to reply to metadata queries
198+
metadata-timeout = 10s
199+
# How many outstanding requests a connection is allowed to have before sending on it blocks
200+
net-max-open-requests = 100
201+
# Client group session and failure detection timeout
202+
session-timeout = 10s
181203
# tcp address (may be given multiple times as a comma-separated list)
182204
brokers = kafka:9092
183205
# kafka topic (may be given multiple times as a comma-separated list)
184206
topics = mdm
185207
# offset to start consuming from. Can be one of newest, oldest or a time duration
208+
# When using a duration but the offset request fails (e.g. Kafka doesn't have data so far back), metrictank falls back to `oldest`.
186209
# the further back in time you go, the more old data you can load into metrictank, but the longer it takes to catch up to realtime data
187210
offset = oldest
188211
# kafka partitions to consume. use '*' or a comma separated list of id's
189212
partitions = *
190-
# save interval for consumption lag
191-
lag-collection-interval = 5s
192-
# directory to store partition offsets index. supports relative or absolute paths. empty means working dir.
193-
# it will be created (incl parent dirs) if not existing.
194-
data-dir = /var/lib/metrictank
195-
# The number of metrics to buffer in internal and external channels
196-
channel-buffer-size = 1000
197-
# The minimum number of message bytes to fetch in a request
198-
consumer-fetch-min = 1
199-
# The default number of message bytes to fetch in a request
200-
consumer-fetch-default = 32768
201-
# The maximum amount of time the broker will wait for Consumer.Fetch.Min bytes to become available before it
202-
consumer-max-wait = 1s
203-
# How many outstanding requests a connection is allowed to have before sending on it blocks
204-
net-max-open-requests = 100
205213

206214
## basic clustering settings ##
207215
[cluster]
@@ -279,14 +287,33 @@ partitions = *
279287
# method used for partitioning metrics. This should match the settings of tsdb-gw. (byOrg|bySeries)
280288
partition-scheme = bySeries
281289
# offset to start consuming from. Can be one of newest, oldest or a time duration
290+
# When using a duration but the offset request fails (e.g. Kafka doesn't have data so far back), metrictank falls back to `oldest`.
291+
# Should match your kafka-mdm-in setting
282292
offset = oldest
283293
# save interval for consumption lag
284294
lag-collection-interval = 5s
295+
# Maximum number of messages batched in one MessageSet
296+
batch-num-messages = 10000
297+
# Delay in milliseconds to wait for messages in the producer queue to accumulate before constructing message batches (MessageSets) to transmit to brokers
298+
metrics-buffer-max = 100ms
299+
# The number of metrics to buffer in internal and external channels
300+
channel-buffer-size = 1000
285301
# Maximum time backlog processing can block during metrictank startup.
286302
backlog-process-timeout = 60s
287-
# directory to store partition offsets index. supports relative or absolute paths. empty means working dir.
288-
# it will be created (incl parent dirs) if not existing.
289-
data-dir = /var/lib/metrictank
303+
# The minimum number of message bytes to fetch in a request
304+
fetch-min = 1
305+
# The maximum amount of time the broker will wait for Consumer.Fetch.Min bytes to become available before it
306+
max-wait = 1s
307+
# Time to wait between attempts to fetch metadata
308+
metadata-backoff-time = 500ms
309+
# Number of retries to fetch metadata in case of failure
310+
metadata-retries = 5
311+
# Maximum time to wait for the broker to reply to metadata queries
312+
metadata-timeout = 10s
313+
# How many outstanding requests a connection is allowed to have before sending on it blocks
314+
net-max-open-requests = 100
315+
# Client group session and failure detection timeout
316+
session-timeout = 10s
290317

291318
### nsq as transport for clustering messages
292319
[nsq-cluster]

docker/docker-dev-custom-cfg-kafka/metrictank.ini

+42-18
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,28 @@ partition = 0
178178
enabled = true
179179
# For incoming MetricPoint messages without org-id, assume this org id
180180
org-id = 1
181+
# save interval for consumption lag
182+
lag-collection-interval = 5s
183+
# Maximum number of messages batched in one MessageSet
184+
batch-num-messages = 10000
185+
# Delay in milliseconds to wait for messages in the producer queue to accumulate before constructing message batches (MessageSets) to transmit to brokers
186+
metrics-buffer-max = 100ms
187+
# The number of metrics to buffer in internal and external channels
188+
channel-buffer-size = 1000
189+
# The minimum number of message bytes to fetch in a request
190+
fetch-min = 1
191+
# The maximum amount of time the broker will wait for Consumer.Fetch.Min bytes to become available before it
192+
max-wait = 1s
193+
# Time to wait between attempts to fetch metadata
194+
metadata-backoff-time = 500ms
195+
# Number of retries to fetch metadata in case of failure
196+
metadata-retries = 5
197+
# Maximum time to wait for the broker to reply to metadata queries
198+
metadata-timeout = 10s
199+
# How many outstanding requests a connection is allowed to have before sending on it blocks
200+
net-max-open-requests = 100
201+
# Client group session and failure detection timeout
202+
session-timeout = 10s
181203
# tcp address (may be given multiple times as a comma-separated list)
182204
brokers = kafka:9092
183205
# kafka topic (may be given multiple times as a comma-separated list)
@@ -188,21 +210,6 @@ topics = mdm
188210
offset = oldest
189211
# kafka partitions to consume. use '*' or a comma separated list of id's
190212
partitions = *
191-
# save interval for consumption lag
192-
lag-collection-interval = 5s
193-
# directory to store partition offsets index. supports relative or absolute paths. empty means working dir.
194-
# it will be created (incl parent dirs) if not existing.
195-
data-dir = /var/lib/metrictank
196-
# The number of metrics to buffer in internal and external channels
197-
channel-buffer-size = 1000
198-
# The minimum number of message bytes to fetch in a request
199-
consumer-fetch-min = 1
200-
# The default number of message bytes to fetch in a request
201-
consumer-fetch-default = 32768
202-
# The maximum amount of time the broker will wait for Consumer.Fetch.Min bytes to become available before it
203-
consumer-max-wait = 1s
204-
# How many outstanding requests a connection is allowed to have before sending on it blocks
205-
net-max-open-requests = 100
206213

207214
## basic clustering settings ##
208215
[cluster]
@@ -285,11 +292,28 @@ partition-scheme = bySeries
285292
offset = oldest
286293
# save interval for consumption lag
287294
lag-collection-interval = 5s
295+
# Maximum number of messages batched in one MessageSet
296+
batch-num-messages = 10000
297+
# Delay in milliseconds to wait for messages in the producer queue to accumulate before constructing message batches (MessageSets) to transmit to brokers
298+
metrics-buffer-max = 100ms
299+
# The number of metrics to buffer in internal and external channels
300+
channel-buffer-size = 1000
288301
# Maximum time backlog processing can block during metrictank startup.
289302
backlog-process-timeout = 60s
290-
# directory to store partition offsets index. supports relative or absolute paths. empty means working dir.
291-
# it will be created (incl parent dirs) if not existing.
292-
data-dir = /var/lib/metrictank
303+
# The minimum number of message bytes to fetch in a request
304+
fetch-min = 1
305+
# The maximum amount of time the broker will wait for Consumer.Fetch.Min bytes to become available before it
306+
max-wait = 1s
307+
# Time to wait between attempts to fetch metadata
308+
metadata-backoff-time = 500ms
309+
# Number of retries to fetch metadata in case of failure
310+
metadata-retries = 5
311+
# Maximum time to wait for the broker to reply to metadata queries
312+
metadata-timeout = 10s
313+
# How many outstanding requests a connection is allowed to have before sending on it blocks
314+
net-max-open-requests = 100
315+
# Client group session and failure detection timeout
316+
session-timeout = 10s
293317

294318
### nsq as transport for clustering messages
295319
[nsq-cluster]

docs/config.md

+42-12
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,28 @@ partition = 0
226226
enabled = false
227227
# For incoming MetricPoint messages without org-id, assume this org id
228228
org-id = 0
229+
# save interval for consumption lag
230+
lag-collection-interval = 5s
231+
# Maximum number of messages batched in one MessageSet
232+
batch-num-messages = 10000
233+
# Delay in milliseconds to wait for messages in the producer queue to accumulate before constructing message batches (MessageSets) to transmit to brokers
234+
metrics-buffer-max = 100ms
235+
# The number of metrics to buffer in internal and external channels
236+
channel-buffer-size = 1000
237+
# The minimum number of message bytes to fetch in a request
238+
fetch-min = 1
239+
# The maximum amount of time the broker will wait for Consumer.Fetch.Min bytes to become available before it
240+
max-wait = 1s
241+
# Time to wait between attempts to fetch metadata
242+
metadata-backoff-time = 500ms
243+
# Number of retries to fetch metadata in case of failure
244+
metadata-retries = 5
245+
# Maximum time to wait for the broker to reply to metadata queries
246+
metadata-timeout = 10s
247+
# How many outstanding requests a connection is allowed to have before sending on it blocks
248+
net-max-open-requests = 100
249+
# Client group session and failure detection timeout
250+
session-timeout = 10s
229251
# tcp address (may be given multiple times as a comma-separated list)
230252
brokers = kafka:9092
231253
# kafka topic (may be given multiple times as a comma-separated list)
@@ -236,18 +258,6 @@ topics = mdm
236258
offset = oldest
237259
# kafka partitions to consume. use '*' or a comma separated list of id's
238260
partitions = *
239-
# save interval for consumption lag
240-
lag-collection-interval = 5s
241-
# The number of metrics to buffer in internal and external channels
242-
channel-buffer-size = 1000
243-
# The minimum number of message bytes to fetch in a request
244-
consumer-fetch-min = 1
245-
# The default number of message bytes to fetch in a request
246-
consumer-fetch-default = 32768
247-
# The maximum amount of time the broker will wait for Consumer.Fetch.Min bytes to become available before it
248-
consumer-max-wait = 1s
249-
# How many outstanding requests a connection is allowed to have before sending on it blocks
250-
net-max-open-requests = 100
251261
```
252262

253263
## basic clustering settings ##
@@ -339,8 +349,28 @@ partition-scheme = bySeries
339349
offset = oldest
340350
# save interval for consumption lag
341351
lag-collection-interval = 5s
352+
# Maximum number of messages batched in one MessageSet
353+
batch-num-messages = 10000
354+
# Delay in milliseconds to wait for messages in the producer queue to accumulate before constructing message batches (MessageSets) to transmit to brokers
355+
metrics-buffer-max = 100ms
356+
# The number of metrics to buffer in internal and external channels
357+
channel-buffer-size = 1000
342358
# Maximum time backlog processing can block during metrictank startup.
343359
backlog-process-timeout = 60s
360+
# The minimum number of message bytes to fetch in a request
361+
fetch-min = 1
362+
# The maximum amount of time the broker will wait for Consumer.Fetch.Min bytes to become available before it
363+
max-wait = 1s
364+
# Time to wait between attempts to fetch metadata
365+
metadata-backoff-time = 500ms
366+
# Number of retries to fetch metadata in case of failure
367+
metadata-retries = 5
368+
# Maximum time to wait for the broker to reply to metadata queries
369+
metadata-timeout = 10s
370+
# How many outstanding requests a connection is allowed to have before sending on it blocks
371+
net-max-open-requests = 100
372+
# Client group session and failure detection timeout
373+
session-timeout = 10s
344374
```
345375

346376
### nsq as transport for clustering messages

input/kafkamdm/kafkamdm.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ func ConfigSetup() {
5252
inKafkaMdm.IntVar(&clientConf.BatchNumMessages, "batch-num-messages", 10000, "Maximum number of messages batched in one MessageSet")
5353
inKafkaMdm.DurationVar(&clientConf.BufferMax, "metrics-buffer-max", time.Millisecond*100, "Delay in milliseconds to wait for messages in the producer queue to accumulate before constructing message batches (MessageSets) to transmit to brokers")
5454
inKafkaMdm.IntVar(&clientConf.ChannelBufferSize, "channel-buffer-size", 1000, "Maximum number of messages allowed on the producer queue")
55-
inKafkaMdm.IntVar(&clientConf.FetchMin, "consumer-fetch-min", 1, "Minimum number of bytes the broker responds with. If fetch.wait.max.ms expires the accumulated data will be sent to the client regardless of this setting")
56-
inKafkaMdm.DurationVar(&clientConf.MaxWait, "consumer-max-wait", time.Millisecond*100, "Maximum time the broker may wait to fill the response with fetch.min.bytes")
55+
inKafkaMdm.IntVar(&clientConf.FetchMin, "fetch-min", 1, "Minimum number of bytes the broker responds with. If fetch.wait.max.ms expires the accumulated data will be sent to the client regardless of this setting")
56+
inKafkaMdm.DurationVar(&clientConf.MaxWait, "max-wait", time.Millisecond*100, "Maximum time the broker may wait to fill the response with fetch.min.bytes")
5757
inKafkaMdm.DurationVar(&clientConf.MetadataBackoffTime, "metadata-backoff-time", time.Millisecond*500, "Time to wait between attempts to fetch metadata")
5858
inKafkaMdm.IntVar(&clientConf.MetadataRetries, "metadata-retries", 5, "Number of retries to fetch metadata in case of failure")
59-
inKafkaMdm.DurationVar(&clientConf.MetadataTimeout, "consumer-metadata-timeout", time.Second*10, "Maximum time to wait for the broker to reply to metadata queries")
59+
inKafkaMdm.DurationVar(&clientConf.MetadataTimeout, "metadata-timeout", time.Second*10, "Maximum time to wait for the broker to reply to metadata queries")
6060
inKafkaMdm.IntVar(&clientConf.NetMaxOpenRequests, "net-max-open-requests", 100, "Maximum number of in-flight requests per broker connection. This is a generic property applied to all broker communication, however it is primarily relevant to produce requests.")
61-
inKafkaMdm.DurationVar(&clientConf.SessionTimeout, "consumer-session-timeout", time.Second*30, "Client group session and failure detection timeout")
61+
inKafkaMdm.DurationVar(&clientConf.SessionTimeout, "session-timeout", time.Second*30, "Client group session and failure detection timeout")
6262
inKafkaMdm.StringVar(&clientConf.Broker, "brokers", "kafka:9092", "tcp address for kafka (may be be given multiple times as a comma-separated list)")
6363
inKafkaMdm.StringVar(&clientConf.StartAtOffset, "offset", "oldest", "Set the offset to start consuming from. Can be one of newest, oldest or a time duration")
6464
inKafkaMdm.StringVar(&clientConf.Partitions, "partitions", "*", "kafka partitions to consume. use '*' or a comma separated list of id's")
@@ -76,7 +76,7 @@ func ConfigProcess(instance string) {
7676
}
7777

7878
if clientConf.MaxWait == 0 {
79-
log.Fatal(4, "kafkamdm: consumer-max-wait-time must be greater then 0")
79+
log.Fatal(4, "kafkamdm: max-wait-time must be greater then 0")
8080
}
8181

8282
if !clientConf.OffsetIsValid() {

0 commit comments

Comments
 (0)