Exemplo n.º 1
0
    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))
Exemplo n.º 2
0
 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))
Exemplo n.º 3
0
 def record(self, traces):
     self.destination.write(json_formatter(traces, indent=2))
     self.destination.write('\n')
     self.destination.flush()
Exemplo n.º 4
0
"""
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)
Exemplo n.º 5
0
 def record(self, traces):
     self.destination.write(json_formatter(traces, indent=2))
     self.destination.write('\n')
     self.destination.flush()
Exemplo n.º 6
0
 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))
Exemplo n.º 7
0
    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))