增加环绕侦察场景适配

This commit is contained in:
2026-01-08 15:44:38 +08:00
parent 3eba1f962b
commit 10c5bb5a8a
5441 changed files with 40219 additions and 379695 deletions

View File

@@ -63,7 +63,7 @@ class SpanExporter:
def export(
self, spans: typing.Sequence[ReadableSpan]
) -> "SpanExportResult":
) -> "SpanExportResult": # pyright: ignore[reportReturnType]
"""Exports a batch of telemetry data.
Args:
@@ -79,7 +79,7 @@ class SpanExporter:
Called when the SDK is shut down.
"""
def force_flush(self, timeout_millis: int = 30000) -> bool:
def force_flush(self, timeout_millis: int = 30000) -> bool: # pyright: ignore[reportReturnType]
"""Hint to ensure that the export of any spans the exporter has received
prior to the call to ForceFlush SHOULD be completed as soon as possible, preferably
before returning from this method.
@@ -102,7 +102,7 @@ class SimpleSpanProcessor(SpanProcessor):
pass
def on_end(self, span: ReadableSpan) -> None:
if not span.context.trace_flags.sampled:
if not (span.context and span.context.trace_flags.sampled):
return
token = attach(set_value(_SUPPRESS_INSTRUMENTATION_KEY, True))
try:
@@ -188,7 +188,7 @@ class BatchSpanProcessor(SpanProcessor):
pass
def on_end(self, span: ReadableSpan) -> None:
if not span.context.trace_flags.sampled:
if not (span.context and span.context.trace_flags.sampled):
return
self._batch_processor.emit(span)