|
26 | 26 | from google.rpc.error_details_pb2 import ( # pylint: disable=no-name-in-module |
27 | 27 | RetryInfo, |
28 | 28 | ) |
29 | | -from grpc import Compression, server |
| 29 | +from grpc import Compression, StatusCode, server |
30 | 30 |
|
31 | 31 | from opentelemetry.exporter.otlp.proto.common.trace_encoder import ( |
32 | 32 | encode_spans, |
33 | 33 | ) |
34 | 34 | from opentelemetry.exporter.otlp.proto.grpc.exporter import ( # noqa: F401 |
35 | 35 | InvalidCompressionValueException, |
36 | 36 | OTLPExporterMixin, |
37 | | - StatusCode, |
38 | 37 | environ_to_compression, |
39 | 38 | ) |
40 | 39 | from opentelemetry.exporter.otlp.proto.grpc.version import __version__ |
@@ -81,19 +80,22 @@ def export(self, spans: Sequence[ReadableSpan]) -> SpanExportResult: |
81 | 80 | def _exporting(self): |
82 | 81 | return "traces" |
83 | 82 |
|
| 83 | + def shutdown(self, timeout_millis=30_000): |
| 84 | + return OTLPExporterMixin.shutdown(self, timeout_millis) |
| 85 | + |
84 | 86 |
|
85 | 87 | class TraceServiceServicerWithExportParams(TraceServiceServicer): |
86 | 88 | def __init__( |
87 | 89 | self, |
88 | | - export_result, |
89 | | - optional_export_sleep=None, |
90 | | - optional_export_retry_millis=None, |
| 90 | + export_result: StatusCode, |
| 91 | + optional_export_sleep: Optional[float] = None, |
| 92 | + optional_export_retry_millis: Optional[float] = None, |
91 | 93 | ): |
92 | 94 | self.export_result = export_result |
93 | 95 | self.optional_export_sleep = optional_export_sleep |
94 | 96 | self.optional_export_retry_millis = optional_export_retry_millis |
95 | 97 |
|
96 | | - # pylint: disable=invalid-name,unused-argument,no-self-use |
| 98 | + # pylint: disable=invalid-name,unused-argument |
97 | 99 | def Export(self, request, context): |
98 | 100 | if self.optional_export_sleep: |
99 | 101 | time.sleep(self.optional_export_sleep) |
|
0 commit comments