tom-pytel commented on a change in pull request #149:
URL: https://github.com/apache/skywalking-python/pull/149#discussion_r686980125
##########
File path: skywalking/client/http.py
##########
@@ -109,3 +110,20 @@ def report(self, generator):
} for span in segment.spans]
})
logger.debug('report traces response: %s', res)
+
+
+class HttpLogDataReportService(TraceSegmentReportService):
+ def __init__(self):
+ proto = 'https://' if config.force_tls else 'http://'
+ self.url_report = proto + config.collector_address.rstrip('/') +
'/v3/logs'
+ self.session = requests.Session()
+
+ def fork_after_in_child(self):
+ self.session.close()
+ self.session = requests.Session()
+
+ def report(self, generator):
+ for log_data in generator:
+ json_string = json_format.MessageToJson(log_data)
+ res = self.session.post(self.url_report,
json=[json.loads(json_string)])
Review comment:
No, batch is the right way to go (assuming this endpoint does take
arrays, which is what you should check).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]