Skip to content

Commit 2244e28

Browse files
use old formatting method to support older python versions
1 parent 442db3a commit 2244e28

File tree

2 files changed

+3
-3
lines changed
  • instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka

2 files changed

+3
-3
lines changed

instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def wrap_poll(func, instance, tracer, args, kwargs):
341341
links.append(Link(context=item.get_span_context()))
342342

343343
instance._current_consume_span = tracer.start_span(
344-
name=f"{record.topic()} process",
344+
name="{topic} process".format(topic=record.topic()),
345345
links=links,
346346
kind=SpanKind.CONSUMER,
347347
)

instrumentation/opentelemetry-instrumentation-confluent-kafka/src/opentelemetry/instrumentation/confluent_kafka/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ def _enrich_span(
9898
if partition and offset and topic:
9999
span.set_attribute(
100100
SpanAttributes.MESSAGING_MESSAGE_ID,
101-
f"{topic}.{partition}.{offset}",
101+
"{topic}.{partition}.{offset}".format(topic=topic,partition=partition,offset=offset),
102102
)
103103

104104

105105
_kafka_setter = KafkaContextSetter()
106106

107107

108108
def _get_span_name(operation: str, topic: str):
109-
return f"{topic} {operation}"
109+
return "{topic} {operation}".format(topic=topic,operation=operation)

0 commit comments

Comments
 (0)