Skip to content

fix(confluent-kafka): use PUBLISH operation for producer spans#4435

Open
alliasgher wants to merge 3 commits intoopen-telemetry:mainfrom
alliasgher:fix-confluent-kafka-produce-operation
Open

fix(confluent-kafka): use PUBLISH operation for producer spans#4435
alliasgher wants to merge 3 commits intoopen-telemetry:mainfrom
alliasgher:fix-confluent-kafka-produce-operation

Conversation

@alliasgher
Copy link
Copy Markdown

Fixes #4292. wrap_produce was setting messaging.operation=RECEIVE on producer spans — the correct OTel semantic value for a produce/send operation is PUBLISH.

…ts gauge leak

If wsgi_app() raises an uncaught exception, the active_requests_counter
decrement at the end of _wrapped_app was never reached, causing the gauge
to permanently read high. Kubernetes HPA and similar systems would see
phantom load.

Add a bare try/except that decrements the counter and re-raises on
exception, matching the pattern already used in the WSGI instrumentation.

Fixes open-telemetry#4431

Signed-off-by: alliasgher <alliasgher123@gmail.com>
Celery's Context object copies all message properties as instance attrs,
including numeric fields like timelimit. CeleryGetter.get() wrapped these
in a tuple but didn't convert to str, causing TextMapPropagators to crash
with "TypeError: expected string or bytes-like object, got 'int'" when
calling re.split() in TraceState.from_header().

Coerce non-string, non-iterable values to str before wrapping in a tuple.

Fixes open-telemetry#4359

Signed-off-by: alliasgher <alliasgher123@gmail.com>
wrap_produce was setting messaging.operation=RECEIVE on producer spans.
The correct OTel semantic value for a send/produce operation is PUBLISH.

Fixes open-telemetry#4292

Signed-off-by: alliasgher <alliasgher123@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

confluent_kafka span attribute info error

1 participant