import sys
import json, ast
from kafka import KafkaConsumer


consumer = KafkaConsumer('metrics_worker', bootstrap_servers='localhost:9092')
for msg in consumer:
    if msg.topic == "metrics_worker":
        msg = msg.value.decode('utf-8')
        worker = json.loads(msg)
        print(worker)