jiang1997 commented on code in PR #243:
URL: https://github.com/apache/skywalking-python/pull/243#discussion_r998992203


##########
skywalking/client/kafka.py:
##########
@@ -127,6 +128,19 @@ def report(self, generator):
             self.producer.send(topic=self.topic, key=key, value=value)
 
 
+class KafkaMeterDataReportService(MeterReportService):
+    def __init__(self):
+        self.producer = KafkaProducer(**kafka_configs)
+        self.topic = config.kafka_topic_meter
+
+    def report(self, generator):
+        collection = MeterDataCollection()
+        collection.meterData.extend(list(generator))
+        key = bytes(config.service_instance, encoding='utf-8')
+        value = bytes(collection.SerializeToString())

Review Comment:
   I tried and it failed to pass tests.
   After some searching, I found that the default string encoding of Java is 
`UTF-8` and the default string encoding of python3 is `UTF-16` or `UTF-32`. So 
the conversion is needed.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to