open-telemetry / opentelemetry-python-contrib

OpenTelemetry instrumentation for Python modules
https://opentelemetry.io
Apache License 2.0
701 stars 584 forks source link

Confluent Kafka: Ensure consume span is ended when consumer is closed #2640

Closed joshschltelus closed 2 months ago

joshschltelus commented 3 months ago

Description

Fix an issue with the confluent kafka instrumentation where the consume span created after a message is received is not closed when the consumer is closed

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Added a unit test for close and tested with

tox -e py310-test-instrumentation-confluent-kafka

Does This PR Require a Core Repo Change?

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.