Skip to content

Commit 366b445

Browse files
committed
fix(confluent-kafka): remove deprecated messaging.url, fix CHANGELOG link
Signed-off-by: alliasgher <alliasgher123@gmail.com>
1 parent 3f3d1b6 commit 366b445

3 files changed

Lines changed: 4 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Fixed
1515

16-
- `opentelemetry-instrumentation-confluent-kafka`: Populate `messaging.url`, `server.address` and `server.port` span attributes from the producer/consumer `bootstrap.servers` config; previously `KafkaPropertiesExtractor.extract_bootstrap_servers` was defined but never called
17-
([#4104](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/4104))
16+
- `opentelemetry-instrumentation-confluent-kafka`: Populate `server.address` and `server.port` span attributes from the producer/consumer `bootstrap.servers` config; previously `KafkaPropertiesExtractor.extract_bootstrap_servers` was defined but never called
17+
([#4423](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4423))
1818

1919
### Breaking changes
2020

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,11 @@ def _get_links_from_records(records):
130130

131131

132132
def _set_bootstrap_servers_attributes(span, bootstrap_servers):
133-
"""Populate messaging.url, server.address, server.port from a
134-
bootstrap.servers string (e.g. ``host1:9092,host2:9092``)."""
133+
"""Populate server.address and server.port from a bootstrap.servers
134+
string (e.g. ``host1:9092,host2:9092``)."""
135135
if not bootstrap_servers:
136136
return
137137

138-
span.set_attribute(SpanAttributes.MESSAGING_URL, bootstrap_servers)
139-
140138
first_broker = bootstrap_servers.split(",")[0].strip()
141139
if not first_broker:
142140
return

instrumentation/opentelemetry-instrumentation-confluent-kafka/tests/test_instrumentation.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,6 @@ def test_producer_sets_bootstrap_servers_attributes(self) -> None:
465465
producer.produce(topic="topic-1", key="k", value="v")
466466

467467
span = self.memory_exporter.get_finished_spans()[0]
468-
self.assertEqual(
469-
span.attributes[SpanAttributes.MESSAGING_URL],
470-
"broker-a:9092,broker-b:9093",
471-
)
472468
self.assertEqual(span.attributes[SERVER_ADDRESS], "broker-a")
473469
self.assertEqual(span.attributes[SERVER_PORT], 9092)
474470

@@ -495,9 +491,5 @@ def test_consumer_sets_bootstrap_servers_attributes(self) -> None:
495491
for s in self.memory_exporter.get_finished_spans()
496492
if s.name == "topic-1 process"
497493
)
498-
self.assertEqual(
499-
process_span.attributes[SpanAttributes.MESSAGING_URL],
500-
"broker-1:9092",
501-
)
502494
self.assertEqual(process_span.attributes[SERVER_ADDRESS], "broker-1")
503495
self.assertEqual(process_span.attributes[SERVER_PORT], 9092)

0 commit comments

Comments
 (0)