def record(self, traces): producer = FileBodyProducer(StringIO(json_formatter(traces))) d = self._agent.request('POST', self._trace_url, Headers({}), producer) d.addErrback( log.err, "Error sending trace to: {0}".format(self._trace_url))
def record(self, traces): d = self._scribe_client.log( self._category, [json_formatter(traces)]) d.addErrback( log.err, "Error sending trace to scribe category: {0}".format( self._category))
def record(self, traces): self.destination.write(json_formatter(traces, indent=2)) self.destination.write('\n') self.destination.flush()
""" Python script that produces base64 and json formats of a trace and a set of annotations, so they can be tested in the node port. """ from tryfer import formatters from tryfer.trace import Trace, Endpoint, Annotation trace = Trace('trace', trace_id=100, span_id=10, parent_span_id=5) endpoint = Endpoint('1.2.3.4', 8080, 'myservice') annotations = [Annotation.timestamp('mytime', 1), Annotation.string('mystring', 'value')] for annotation in annotations: annotation.endpoint = endpoint print formatters.base64_thrift_formatter(trace, annotations) print formatters.json_formatter(trace, annotations)
def record(self, traces): d = self._scribe_client.log(self._category, [json_formatter(traces)]) d.addErrback( log.err, "Error sending trace to scribe category: {0}".format( self._category))
def record(self, traces): producer = FileBodyProducer(StringIO(json_formatter(traces))) d = self._agent.request('POST', self._trace_url, Headers({}), producer) d.addErrback(log.err, "Error sending trace to: {0}".format(self._trace_url))