コード例 #1
0
ファイル: tracers.py プロジェクト: andrew-plunk/tryfer
    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))
コード例 #2
0
ファイル: tracers.py プロジェクト: andrew-plunk/tryfer
 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))
コード例 #3
0
ファイル: tracers.py プロジェクト: andrew-plunk/tryfer
 def record(self, traces):
     self.destination.write(json_formatter(traces, indent=2))
     self.destination.write('\n')
     self.destination.flush()
コード例 #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)
コード例 #5
0
ファイル: tracers.py プロジェクト: bbotte/tryfer-zipkin
 def record(self, traces):
     self.destination.write(json_formatter(traces, indent=2))
     self.destination.write('\n')
     self.destination.flush()
コード例 #6
0
ファイル: tracers.py プロジェクト: bbotte/tryfer-zipkin
 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))
コード例 #7
0
ファイル: tracers.py プロジェクト: bbotte/tryfer-zipkin
    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))