From d614cf0a1a5debc48985a1bab81bb5dec236bd59 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Thu, 1 Nov 2018 10:53:28 -0500 Subject: [PATCH 01/14] Turn print into log statements --- .../trace/exporters/transports/background_thread.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/opencensus/trace/exporters/transports/background_thread.py b/opencensus/trace/exporters/transports/background_thread.py index 0768ee737..4cd302080 100644 --- a/opencensus/trace/exporters/transports/background_thread.py +++ b/opencensus/trace/exporters/transports/background_thread.py @@ -85,7 +85,7 @@ def _thread_main(self): Pulls pending SpanData tuples off the queue and writes them in batches to the specified tracing backend using the exporter. """ - print('Background thread started.') + logging.debug('Background thread started.') quit_ = False @@ -121,7 +121,7 @@ def _thread_main(self): if quit_: break - print('Background thread exited.') + logging.debug('Background thread exited.') def start(self): """Starts the background thread. @@ -176,12 +176,12 @@ def _export_pending_spans(self): return if not self._queue.empty(): - print('Sending all pending spans before terminated.') + logging.info('Sending all pending spans before terminated.') if self.stop(): - print('Sent all pending spans.') + logging.info('Sent all pending spans.') else: - print('Failed to send pending spans.') + logging.error('Failed to send pending spans.') def enqueue(self, span_datas): """Queues span_datas to be written by the background thread.""" From 5a58e87631d51b211714d3b34d4bc74b9a25fc44 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Thu, 1 Nov 2018 16:08:47 -0500 Subject: [PATCH 02/14] Add ability to pass options to the transport --- opencensus/trace/exporters/base.py | 15 ++++++++++++++- opencensus/trace/exporters/file_exporter.py | 7 +++---- opencensus/trace/exporters/jaeger_exporter.py | 9 +++++++-- opencensus/trace/exporters/logging_exporter.py | 6 ++++-- opencensus/trace/exporters/print_exporter.py | 4 ++-- .../trace/exporters/stackdriver_exporter.py | 4 ++-- .../exporters/transports/background_thread.py | 2 +- opencensus/trace/exporters/zipkin_exporter.py | 3 ++- 8 files changed, 35 insertions(+), 15 deletions(-) diff --git a/opencensus/trace/exporters/base.py b/opencensus/trace/exporters/base.py index 8011e86fc..384d0ed9d 100644 --- a/opencensus/trace/exporters/base.py +++ b/opencensus/trace/exporters/base.py @@ -20,7 +20,6 @@ class Exporter(object): Subclasses of :class:`Exporter` must override :meth:`export`. """ - def emit(self, span_datas): """ :type span_datas: list of :class: @@ -41,3 +40,17 @@ def export(self, span_datas): SpanData tuples to export """ raise NotImplementedError + + def __init_transport(self, cls, config=None): + """Initiate the transport instance to be used by the exporter. + + :type cls: :class: + `~opencensus.trace.exporters.transports.base.Transport` + :param transport class to use for the exporter. + + :type config dict + :param dict of config options to initiate the transport with. + """ + if config is None: + return cls(self) + return cls(self, **config) diff --git a/opencensus/trace/exporters/file_exporter.py b/opencensus/trace/exporters/file_exporter.py index f250d1e15..2a4825dad 100644 --- a/opencensus/trace/exporters/file_exporter.py +++ b/opencensus/trace/exporters/file_exporter.py @@ -41,12 +41,11 @@ class FileExporter(base.Exporter): """ - def __init__(self, file_name=DEFAULT_FILENAME, - transport=sync.SyncTransport, - file_mode='w+'): + def __init__(self, file_name=DEFAULT_FILENAME, file_mode='w+', + transport=sync.SyncTransport, transport_config=None): self.file_name = file_name - self.transport = transport(self) self.file_mode = file_mode + self.transport = self.__init_transport(transport, transport_config) def emit(self, span_datas): """ diff --git a/opencensus/trace/exporters/jaeger_exporter.py b/opencensus/trace/exporters/jaeger_exporter.py index 32024e532..a4a21ee6d 100644 --- a/opencensus/trace/exporters/jaeger_exporter.py +++ b/opencensus/trace/exporters/jaeger_exporter.py @@ -72,6 +72,9 @@ class JaegerExporter(base.Exporter): implement :meth:`.Transport.export`. Defaults to :class:`.SyncTransport`. The other option is :class:`.BackgroundThreadTransport`. + + :type transport_config + :param """ def __init__( @@ -85,8 +88,9 @@ def __init__( agent_host_name=DEFAULT_HOST_NAME, agent_port=DEFAULT_AGENT_PORT, agent_endpoint=DEFAULT_ENDPOINT, - transport=sync.SyncTransport): - self.transport = transport(self) + transport=sync.SyncTransport, + transport_config=None + ): self.service_name = service_name self.host_name = host_name self.agent_host_name = agent_host_name @@ -97,6 +101,7 @@ def __init__( self.password = password self._agent_client = None self._collector = None + self.transport = self.__init_transport(transport, transport_config) @property def agent_client(self): diff --git a/opencensus/trace/exporters/logging_exporter.py b/opencensus/trace/exporters/logging_exporter.py index 83002d217..8af8b258e 100644 --- a/opencensus/trace/exporters/logging_exporter.py +++ b/opencensus/trace/exporters/logging_exporter.py @@ -53,7 +53,8 @@ class LoggingExporter(base.Exporter): will be exported to logging when finished. """ - def __init__(self, handler=None, transport=sync.SyncTransport): + def __init__(self, handler=None, transport=sync.SyncTransport, + transport_config=None): self.logger = logging.getLogger() if handler is None: @@ -62,7 +63,8 @@ def __init__(self, handler=None, transport=sync.SyncTransport): self.handler = handler self.logger.addHandler(handler) self.logger.setLevel(logging.INFO) - self.transport = transport(self) + + self.transport = self.__init_transport(transport, transport_config) def emit(self, span_datas): """ diff --git a/opencensus/trace/exporters/print_exporter.py b/opencensus/trace/exporters/print_exporter.py index 72a30bcf9..e060be58f 100644 --- a/opencensus/trace/exporters/print_exporter.py +++ b/opencensus/trace/exporters/print_exporter.py @@ -29,8 +29,8 @@ class PrintExporter(base.Exporter): :class:`.BackgroundThreadTransport`. """ - def __init__(self, transport=sync.SyncTransport): - self.transport = transport(self) + def __init__(self, transport=sync.SyncTransport, transport_config=None): + self.transport = self.__init_transport(transport, transport_config) def emit(self, span_datas): """ diff --git a/opencensus/trace/exporters/stackdriver_exporter.py b/opencensus/trace/exporters/stackdriver_exporter.py index 95ae9f7ab..2b56c5bb1 100644 --- a/opencensus/trace/exporters/stackdriver_exporter.py +++ b/opencensus/trace/exporters/stackdriver_exporter.py @@ -192,14 +192,14 @@ class StackdriverExporter(base.Exporter): """ def __init__(self, client=None, project_id=None, - transport=sync.SyncTransport): + transport=sync.SyncTransport, transport_config=None): # The client will handle the case when project_id is None if client is None: client = Client(project=project_id) self.client = client self.project_id = client.project - self.transport = transport(self) + self.transport = self.__init_transport(transport, transport_config) def emit(self, span_datas): """ diff --git a/opencensus/trace/exporters/transports/background_thread.py b/opencensus/trace/exporters/transports/background_thread.py index 4cd302080..c10aafd18 100644 --- a/opencensus/trace/exporters/transports/background_thread.py +++ b/opencensus/trace/exporters/transports/background_thread.py @@ -217,7 +217,7 @@ def __init__(self, exporter, grace_period=_DEFAULT_GRACE_PERIOD, self.worker.start() def export(self, span_datas): - """Put the trace to be exported into queue.""" + """Put the traces to be exported into queue.""" self.worker.enqueue(span_datas) def flush(self): diff --git a/opencensus/trace/exporters/zipkin_exporter.py b/opencensus/trace/exporters/zipkin_exporter.py index cd1d21352..27599500a 100644 --- a/opencensus/trace/exporters/zipkin_exporter.py +++ b/opencensus/trace/exporters/zipkin_exporter.py @@ -75,6 +75,7 @@ def __init__( endpoint=DEFAULT_ENDPOINT, protocol=DEFAULT_PROTOCOL, transport=sync.SyncTransport, + transport_config=None, ipv4=None, ipv6=None): self.service_name = service_name @@ -83,9 +84,9 @@ def __init__( self.endpoint = endpoint self.protocol = protocol self.url = self.get_url - self.transport = transport(self) self.ipv4 = ipv4 self.ipv6 = ipv6 + self.transport = self.__init_transport(transport, transport_config) @property def get_url(self): From c35c5f074630218e5e1998298f0f2967c0165049 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Thu, 1 Nov 2018 16:15:17 -0500 Subject: [PATCH 03/14] Remove logging statements (opened in another PR) --- .../trace/exporters/transports/background_thread.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opencensus/trace/exporters/transports/background_thread.py b/opencensus/trace/exporters/transports/background_thread.py index c10aafd18..8b904c48b 100644 --- a/opencensus/trace/exporters/transports/background_thread.py +++ b/opencensus/trace/exporters/transports/background_thread.py @@ -121,7 +121,7 @@ def _thread_main(self): if quit_: break - logging.debug('Background thread exited.') + print('Background thread exited.') def start(self): """Starts the background thread. @@ -176,12 +176,12 @@ def _export_pending_spans(self): return if not self._queue.empty(): - logging.info('Sending all pending spans before terminated.') + print('Sending all pending spans before terminated.') if self.stop(): - logging.info('Sent all pending spans.') + print('Sent all pending spans.') else: - logging.error('Failed to send pending spans.') + print('Failed to send pending spans.') def enqueue(self, span_datas): """Queues span_datas to be written by the background thread.""" From b401e650a4fee1dc1ed90603ee8a45d5dcc2c75b Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Thu, 1 Nov 2018 16:16:15 -0500 Subject: [PATCH 04/14] Remove logging statements (opened in another PR) --- opencensus/trace/exporters/transports/background_thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencensus/trace/exporters/transports/background_thread.py b/opencensus/trace/exporters/transports/background_thread.py index 8b904c48b..1b02be4d9 100644 --- a/opencensus/trace/exporters/transports/background_thread.py +++ b/opencensus/trace/exporters/transports/background_thread.py @@ -85,7 +85,7 @@ def _thread_main(self): Pulls pending SpanData tuples off the queue and writes them in batches to the specified tracing backend using the exporter. """ - logging.debug('Background thread started.') + print('Background thread started.') quit_ = False From 2e4b720e69562990577633f53d89296af9bca3c1 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Fri, 2 Nov 2018 11:58:57 -0500 Subject: [PATCH 05/14] Update jaeger_exporter.py --- opencensus/trace/exporters/jaeger_exporter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opencensus/trace/exporters/jaeger_exporter.py b/opencensus/trace/exporters/jaeger_exporter.py index a4a21ee6d..fcf4c31dc 100644 --- a/opencensus/trace/exporters/jaeger_exporter.py +++ b/opencensus/trace/exporters/jaeger_exporter.py @@ -73,8 +73,8 @@ class JaegerExporter(base.Exporter): :class:`.SyncTransport`. The other option is :class:`.BackgroundThreadTransport`. - :type transport_config - :param + :type transport_config: :class:`dict` + :param transport_config: Transport configuration dictionary. """ def __init__( From 2d50598619689b2ade2a36870f8bdf65def29505 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Fri, 2 Nov 2018 12:00:28 -0500 Subject: [PATCH 06/14] Add docstring for `transport_config` --- opencensus/trace/exporters/file_exporter.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/opencensus/trace/exporters/file_exporter.py b/opencensus/trace/exporters/file_exporter.py index 2a4825dad..785114fec 100644 --- a/opencensus/trace/exporters/file_exporter.py +++ b/opencensus/trace/exporters/file_exporter.py @@ -28,17 +28,19 @@ class FileExporter(base.Exporter): :type file_name: str :param file_name: The name of the output file. + :type file_mode: str + :param file_mode: The file mode to open the output file with. + Defaults to w+ + :type transport: :class:`type` :param transport: Class for creating new transport objects. It should extend from the base :class:`.Transport` type and implement :meth:`.Transport.export`. Defaults to :class:`.SyncTransport`. The other option is :class:`.BackgroundThreadTransport`. - - :type file_mode: str - :param file_mode: The file mode to open the output file with. - Defaults to w+ - + + :type transport_config: :class:`dict` + :param transport_config: Transport configuration dictionary. """ def __init__(self, file_name=DEFAULT_FILENAME, file_mode='w+', From 39b0dcb1ca49096a49c5a94332912d1f9c5296b0 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Fri, 2 Nov 2018 12:01:05 -0500 Subject: [PATCH 07/14] Add docstring for `transport_config` --- opencensus/trace/exporters/logging_exporter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opencensus/trace/exporters/logging_exporter.py b/opencensus/trace/exporters/logging_exporter.py index 8af8b258e..eb7a7fefd 100644 --- a/opencensus/trace/exporters/logging_exporter.py +++ b/opencensus/trace/exporters/logging_exporter.py @@ -35,6 +35,9 @@ class LoggingExporter(base.Exporter): :class:`.SyncTransport`. The other option is :class:`.BackgroundThreadTransport`. + :type transport_config: :class:`dict` + :param transport_config: Transport configuration dictionary. + Example: .. code-block:: python From c0fbc1e5f10932efc121eba67662a4d232f082cd Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Fri, 2 Nov 2018 12:01:24 -0500 Subject: [PATCH 08/14] Update print_exporter.py --- opencensus/trace/exporters/print_exporter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opencensus/trace/exporters/print_exporter.py b/opencensus/trace/exporters/print_exporter.py index e060be58f..921805cb3 100644 --- a/opencensus/trace/exporters/print_exporter.py +++ b/opencensus/trace/exporters/print_exporter.py @@ -27,6 +27,9 @@ class PrintExporter(base.Exporter): implement :meth:`.Transport.export`. Defaults to :class:`.SyncTransport`. The other option is :class:`.BackgroundThreadTransport`. + + :type transport_config: :class:`dict` + :param transport_config: Transport configuration dictionary. """ def __init__(self, transport=sync.SyncTransport, transport_config=None): From 5304ac10053593e7b042bcf41036eba29f232828 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Fri, 2 Nov 2018 12:02:12 -0500 Subject: [PATCH 09/14] Update stackdriver_exporter.py --- opencensus/trace/exporters/stackdriver_exporter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opencensus/trace/exporters/stackdriver_exporter.py b/opencensus/trace/exporters/stackdriver_exporter.py index 2b56c5bb1..0ab34aba4 100644 --- a/opencensus/trace/exporters/stackdriver_exporter.py +++ b/opencensus/trace/exporters/stackdriver_exporter.py @@ -189,6 +189,9 @@ class StackdriverExporter(base.Exporter): implement :meth:`.Transport.export`. Defaults to :class:`.SyncTransport`. The other option is :class:`.BackgroundThreadTransport`. + + :type transport_config: :class:`dict` + :param transport_config: Transport configuration dictionary. """ def __init__(self, client=None, project_id=None, From e3fddc2a5aac45a3dc84be3e7fd09546e220d8c3 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Fri, 2 Nov 2018 16:57:38 -0500 Subject: [PATCH 10/14] Fix transport init --- opencensus/trace/exporters/base.py | 25 +++++++++++-------- opencensus/trace/exporters/file_exporter.py | 2 +- opencensus/trace/exporters/jaeger_exporter.py | 2 +- .../trace/exporters/logging_exporter.py | 3 +-- opencensus/trace/exporters/print_exporter.py | 2 +- .../trace/exporters/stackdriver_exporter.py | 2 +- opencensus/trace/exporters/zipkin_exporter.py | 2 +- 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/opencensus/trace/exporters/base.py b/opencensus/trace/exporters/base.py index 384d0ed9d..568ac08e7 100644 --- a/opencensus/trace/exporters/base.py +++ b/opencensus/trace/exporters/base.py @@ -41,16 +41,19 @@ def export(self, span_datas): """ raise NotImplementedError - def __init_transport(self, cls, config=None): - """Initiate the transport instance to be used by the exporter. +def init_transport(exporter, transport, config=None): + """Initiate a transport instance to be used by the exporter. - :type cls: :class: - `~opencensus.trace.exporters.transports.base.Transport` - :param transport class to use for the exporter. + :type exporter: :class: `~opencensus.trace.exporters.base.Exporter` + :param exporter exporter instance. - :type config dict - :param dict of config options to initiate the transport with. - """ - if config is None: - return cls(self) - return cls(self, **config) + :type transport: :class: + `~opencensus.trace.exporters.transports.base.Transport` + :param transport class to use for the exporter. + + :type config: :class:`dict` + :param dict of config options to initiate the transport with. + """ + if config is None: + return transport(exporter) + return transport(exporter, **config) diff --git a/opencensus/trace/exporters/file_exporter.py b/opencensus/trace/exporters/file_exporter.py index 2a4825dad..d9f250d17 100644 --- a/opencensus/trace/exporters/file_exporter.py +++ b/opencensus/trace/exporters/file_exporter.py @@ -45,7 +45,7 @@ def __init__(self, file_name=DEFAULT_FILENAME, file_mode='w+', transport=sync.SyncTransport, transport_config=None): self.file_name = file_name self.file_mode = file_mode - self.transport = self.__init_transport(transport, transport_config) + self.transport = base.init_transport(self, transport, transport_config) def emit(self, span_datas): """ diff --git a/opencensus/trace/exporters/jaeger_exporter.py b/opencensus/trace/exporters/jaeger_exporter.py index a4a21ee6d..0aaa4822b 100644 --- a/opencensus/trace/exporters/jaeger_exporter.py +++ b/opencensus/trace/exporters/jaeger_exporter.py @@ -101,7 +101,7 @@ def __init__( self.password = password self._agent_client = None self._collector = None - self.transport = self.__init_transport(transport, transport_config) + self.transport = base.init_transport(self, transport, transport_config) @property def agent_client(self): diff --git a/opencensus/trace/exporters/logging_exporter.py b/opencensus/trace/exporters/logging_exporter.py index 8af8b258e..ed9acc76c 100644 --- a/opencensus/trace/exporters/logging_exporter.py +++ b/opencensus/trace/exporters/logging_exporter.py @@ -63,8 +63,7 @@ def __init__(self, handler=None, transport=sync.SyncTransport, self.handler = handler self.logger.addHandler(handler) self.logger.setLevel(logging.INFO) - - self.transport = self.__init_transport(transport, transport_config) + self.transport = base.init_transport(self, transport, transport_config) def emit(self, span_datas): """ diff --git a/opencensus/trace/exporters/print_exporter.py b/opencensus/trace/exporters/print_exporter.py index e060be58f..a4af7f23b 100644 --- a/opencensus/trace/exporters/print_exporter.py +++ b/opencensus/trace/exporters/print_exporter.py @@ -30,7 +30,7 @@ class PrintExporter(base.Exporter): """ def __init__(self, transport=sync.SyncTransport, transport_config=None): - self.transport = self.__init_transport(transport, transport_config) + self.transport = base.init_transport(self, transport, transport_config) def emit(self, span_datas): """ diff --git a/opencensus/trace/exporters/stackdriver_exporter.py b/opencensus/trace/exporters/stackdriver_exporter.py index 2b56c5bb1..13dd5b1f6 100644 --- a/opencensus/trace/exporters/stackdriver_exporter.py +++ b/opencensus/trace/exporters/stackdriver_exporter.py @@ -199,7 +199,7 @@ def __init__(self, client=None, project_id=None, self.client = client self.project_id = client.project - self.transport = self.__init_transport(transport, transport_config) + self.transport = base.init_transport(self, transport, transport_config) def emit(self, span_datas): """ diff --git a/opencensus/trace/exporters/zipkin_exporter.py b/opencensus/trace/exporters/zipkin_exporter.py index 27599500a..0c9b58620 100644 --- a/opencensus/trace/exporters/zipkin_exporter.py +++ b/opencensus/trace/exporters/zipkin_exporter.py @@ -86,7 +86,7 @@ def __init__( self.url = self.get_url self.ipv4 = ipv4 self.ipv6 = ipv6 - self.transport = self.__init_transport(transport, transport_config) + self.transport = base.init_transport(self, transport, transport_config) @property def get_url(self): From 2663b292b9123a15c1ca2dc61a636c64062f41c9 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Fri, 2 Nov 2018 16:59:58 -0500 Subject: [PATCH 11/14] Update --- opencensus/trace/exporters/file_exporter.py | 4 ++-- opencensus/trace/exporters/print_exporter.py | 2 +- opencensus/trace/exporters/stackdriver_exporter.py | 2 +- opencensus/trace/exporters/zipkin_exporter.py | 3 +++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/opencensus/trace/exporters/file_exporter.py b/opencensus/trace/exporters/file_exporter.py index ee818f23b..2d81775f4 100644 --- a/opencensus/trace/exporters/file_exporter.py +++ b/opencensus/trace/exporters/file_exporter.py @@ -31,14 +31,14 @@ class FileExporter(base.Exporter): :type file_mode: str :param file_mode: The file mode to open the output file with. Defaults to w+ - + :type transport: :class:`type` :param transport: Class for creating new transport objects. It should extend from the base :class:`.Transport` type and implement :meth:`.Transport.export`. Defaults to :class:`.SyncTransport`. The other option is :class:`.BackgroundThreadTransport`. - + :type transport_config: :class:`dict` :param transport_config: Transport configuration dictionary. """ diff --git a/opencensus/trace/exporters/print_exporter.py b/opencensus/trace/exporters/print_exporter.py index dec901b16..abdf5288e 100644 --- a/opencensus/trace/exporters/print_exporter.py +++ b/opencensus/trace/exporters/print_exporter.py @@ -27,7 +27,7 @@ class PrintExporter(base.Exporter): implement :meth:`.Transport.export`. Defaults to :class:`.SyncTransport`. The other option is :class:`.BackgroundThreadTransport`. - + :type transport_config: :class:`dict` :param transport_config: Transport configuration dictionary. """ diff --git a/opencensus/trace/exporters/stackdriver_exporter.py b/opencensus/trace/exporters/stackdriver_exporter.py index a2265734a..ffafd709c 100644 --- a/opencensus/trace/exporters/stackdriver_exporter.py +++ b/opencensus/trace/exporters/stackdriver_exporter.py @@ -189,7 +189,7 @@ class StackdriverExporter(base.Exporter): implement :meth:`.Transport.export`. Defaults to :class:`.SyncTransport`. The other option is :class:`.BackgroundThreadTransport`. - + :type transport_config: :class:`dict` :param transport_config: Transport configuration dictionary. """ diff --git a/opencensus/trace/exporters/zipkin_exporter.py b/opencensus/trace/exporters/zipkin_exporter.py index 0c9b58620..23e967b8b 100644 --- a/opencensus/trace/exporters/zipkin_exporter.py +++ b/opencensus/trace/exporters/zipkin_exporter.py @@ -65,6 +65,9 @@ class ZipkinExporter(base.Exporter): implement :meth:`.Transport.export`. Defaults to :class:`.SyncTransport`. The other option is :class:`.BackgroundThreadTransport`. + + :type transport_config: :class:`dict` + :param transport_config: Transport configuration dictionary. """ def __init__( From 47aa70a74133c6037c9daa2361cbdf337a7982e4 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Fri, 2 Nov 2018 17:00:58 -0500 Subject: [PATCH 12/14] Update base.py --- opencensus/trace/exporters/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/opencensus/trace/exporters/base.py b/opencensus/trace/exporters/base.py index 568ac08e7..3489c60c0 100644 --- a/opencensus/trace/exporters/base.py +++ b/opencensus/trace/exporters/base.py @@ -20,6 +20,7 @@ class Exporter(object): Subclasses of :class:`Exporter` must override :meth:`export`. """ + def emit(self, span_datas): """ :type span_datas: list of :class: From e895990d3d5e5fd713206611f833e29cf2eaffe9 Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Fri, 2 Nov 2018 17:01:33 -0500 Subject: [PATCH 13/14] Update base.py --- opencensus/trace/exporters/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencensus/trace/exporters/base.py b/opencensus/trace/exporters/base.py index 3489c60c0..31564fbe1 100644 --- a/opencensus/trace/exporters/base.py +++ b/opencensus/trace/exporters/base.py @@ -20,7 +20,7 @@ class Exporter(object): Subclasses of :class:`Exporter` must override :meth:`export`. """ - + def emit(self, span_datas): """ :type span_datas: list of :class: From e1bc86633cc748fb18e2ffd29aad8785816a057c Mon Sep 17 00:00:00 2001 From: Olivier Cervello Date: Fri, 9 Nov 2018 22:39:50 -0600 Subject: [PATCH 14/14] Fix flake8 issues --- opencensus/trace/exporters/base.py | 1 + opencensus/trace/exporters/jaeger_exporter.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opencensus/trace/exporters/base.py b/opencensus/trace/exporters/base.py index 31564fbe1..584482a18 100644 --- a/opencensus/trace/exporters/base.py +++ b/opencensus/trace/exporters/base.py @@ -42,6 +42,7 @@ def export(self, span_datas): """ raise NotImplementedError + def init_transport(exporter, transport, config=None): """Initiate a transport instance to be used by the exporter. diff --git a/opencensus/trace/exporters/jaeger_exporter.py b/opencensus/trace/exporters/jaeger_exporter.py index 82717fed0..ddd030e43 100644 --- a/opencensus/trace/exporters/jaeger_exporter.py +++ b/opencensus/trace/exporters/jaeger_exporter.py @@ -89,8 +89,7 @@ def __init__( agent_port=DEFAULT_AGENT_PORT, agent_endpoint=DEFAULT_ENDPOINT, transport=sync.SyncTransport, - transport_config=None - ): + transport_config=None): self.service_name = service_name self.host_name = host_name self.agent_host_name = agent_host_name