Skip to content

Commit e8700fc

Browse files
author
Liudmila Molkova
committed
lint
1 parent 7a3c685 commit e8700fc

File tree

3 files changed

+4
-12
lines changed
  • instrumentation
    • opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika
    • opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka
    • opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy

3 files changed

+4
-12
lines changed

instrumentation/opentelemetry-instrumentation-aio-pika/src/opentelemetry/instrumentation/aio_pika/span_builder.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,7 @@ def build(self) -> Optional[Span]:
8080
if self._operation:
8181
self._attributes[SpanAttributes.MESSAGING_OPERATION] = self._operation.value
8282
else:
83-
if self._kind == SpanKind.PRODUCER:
84-
self._attributes[SpanAttributes.MESSAGING_DESTINATION_TEMPORARY] = True
85-
else:
86-
self._attributes[SpanAttributes.MESSAGING_SOURCE_TEMPORARY] = True
83+
self._attributes[SpanAttributes.MESSAGING_DESTINATION_TEMPORARY] = True
8784
span = self._tracer.start_span(
8885
self._generate_span_name(), kind=self._kind, attributes=self._attributes
8986
)

instrumentation/opentelemetry-instrumentation-kafka-python/src/opentelemetry/instrumentation/kafka/utils.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,11 @@ def set(self, carrier: textmap.CarrierT, key: str, value: str) -> None:
123123

124124

125125
def _enrich_span(
126-
span,
127-
bootstrap_servers: List[str],
128-
topic: str,
129-
partition: int
126+
span, bootstrap_servers: List[str], topic: str, partition: int
130127
):
131128
if span.is_recording():
132129
span.set_attribute(SpanAttributes.MESSAGING_SYSTEM, "kafka")
133-
span.set_attribute(
134-
SpanAttributes.MESSAGING_DESTINATION_NAME, topic
135-
)
130+
span.set_attribute(SpanAttributes.MESSAGING_DESTINATION_NAME, topic)
136131

137132
span.set_attribute(
138133
SpanAttributes.MESSAGING_KAFKA_DESTINATION_PARTITION, partition

instrumentation/opentelemetry-instrumentation-sqlalchemy/src/opentelemetry/instrumentation/sqlalchemy/engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def _get_attributes_from_cursor(vendor, cursor, attrs):
314314
else:
315315
attrs[
316316
SpanAttributes.NET_TRANSPORT
317-
] = NetTransportValues.TCP_IP.value
317+
] = NetTransportValues.IP_TCP.value
318318

319319
attrs[SpanAttributes.NET_PEER_NAME] = info.host
320320
if info.port:

0 commit comments

Comments
 (0)