Skip to content
Prev Previous commit
Next Next commit
lint
  • Loading branch information
lzchen committed Mar 11, 2024
commit 05557863f726bd1991078be97fdb33f4e7e6dcf2
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ def _record_span(self, span: ReadableSpan) -> None:
_append_quickpulse_document(document)
duration_ms = 0
if span.end_time and span.start_time:
# mypy: disable-error-code="assignment"
duration_ms = (span.end_time - span.start_time) / 1e9
duration_ms = (span.end_time - span.start_time) / 1e9 # type: ignore
# TODO: Spec out what "success" is
success = span.status.is_ok

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from azure.monitor.opentelemetry.exporter._quickpulse._live_metrics import _QuickpulseManager


# pylint: disable=protected-access
class _QuickpulseLogRecordProcessor(LogRecordProcessor):

def emit(self, log_data: LogData) -> None:
Expand All @@ -22,6 +23,7 @@ def force_flush(self, timeout_millis: int = 30000):
super().force_flush(timeout_millis=timeout_millis)


# pylint: disable=protected-access
class _QuickpulseSpanProcessor(SpanProcessor):

def on_end(self, span: ReadableSpan) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def _get_span_document(span: ReadableSpan) -> Union[RemoteDependencyDocument, Re
duration = 0
if span.end_time and span.start_time:
duration = span.end_time - span.start_time
status_code = span.attributes.get(SpanAttributes.HTTP_STATUS_CODE, "")
grpc_status_code = span.attributes.get(SpanAttributes.RPC_GRPC_STATUS_CODE, "")
status_code = span.attributes.get(SpanAttributes.HTTP_STATUS_CODE, "") # type: ignore
grpc_status_code = span.attributes.get(SpanAttributes.RPC_GRPC_STATUS_CODE, "") # type: ignore
span_kind = span.kind
url = _get_url(span_kind, span.attributes)
if span_kind in (SpanKind.CLIENT, SpanKind.PRODUCER, SpanKind.INTERNAL):
Expand All @@ -98,8 +98,8 @@ def _get_span_document(span: ReadableSpan) -> Union[RemoteDependencyDocument, Re

# mypy: disable-error-code="assignment"
def _get_log_record_document(log_data: LogData) -> Union[ExceptionDocument, TraceDocument]:
exc_type = log_data.log_record.attributes.get(SpanAttributes.EXCEPTION_TYPE)
exc_message = log_data.log_record.attributes.get(SpanAttributes.EXCEPTION_MESSAGE)
exc_type = log_data.log_record.attributes.get(SpanAttributes.EXCEPTION_TYPE) # type: ignore
exc_message = log_data.log_record.attributes.get(SpanAttributes.EXCEPTION_MESSAGE) # type: ignore
if exc_type is not None or exc_message is not None:
document = ExceptionDocument(
document_type=_DocumentIngressDocumentType.Exception.value,
Expand Down