summaryrefslogtreecommitdiff
path: root/kafka/coordinator/consumer.py
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2016-08-04 12:19:46 -0700
committerDana Powers <dana.powers@gmail.com>2016-08-04 13:05:36 -0700
commitaf08b54875a5ae5c14fbdeccee4ffe266bda1e00 (patch)
tree51475b859960f304c74c47e0ce394f7451e5ddba /kafka/coordinator/consumer.py
parenta698162dc9bcb228007c4942105515f0eb720c2c (diff)
downloadkafka-python-af08b54875a5ae5c14fbdeccee4ffe266bda1e00.tar.gz
Treat metric_group_prefix as config in KafkaConsumer
Diffstat (limited to 'kafka/coordinator/consumer.py')
-rw-r--r--kafka/coordinator/consumer.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/kafka/coordinator/consumer.py b/kafka/coordinator/consumer.py
index 0429e09..a600cb4 100644
--- a/kafka/coordinator/consumer.py
+++ b/kafka/coordinator/consumer.py
@@ -37,10 +37,10 @@ class ConsumerCoordinator(BaseCoordinator):
'retry_backoff_ms': 100,
'api_version': (0, 9),
'exclude_internal_topics': True,
+ 'metric_group_prefix': 'consumer'
}
- def __init__(self, client, subscription, metrics, metric_group_prefix,
- **configs):
+ def __init__(self, client, subscription, metrics, **configs):
"""Initialize the coordination manager.
Keyword Arguments:
@@ -76,9 +76,7 @@ class ConsumerCoordinator(BaseCoordinator):
True the only way to receive records from an internal topic is
subscribing to it. Requires 0.10+. Default: True
"""
- super(ConsumerCoordinator, self).__init__(client,
- metrics, metric_group_prefix,
- **configs)
+ super(ConsumerCoordinator, self).__init__(client, metrics, **configs)
self.config = copy.copy(self.DEFAULT_CONFIG)
for key in self.config:
@@ -111,7 +109,7 @@ class ConsumerCoordinator(BaseCoordinator):
self._auto_commit_task.reschedule()
self.consumer_sensors = ConsumerCoordinatorMetrics(
- metrics, metric_group_prefix, self._subscription)
+ metrics, self.config['metric_group_prefix'], self._subscription)
def __del__(self):
if hasattr(self, '_cluster') and self._cluster: