You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can see that the context is propergated correctly, however it only appears in the record that aiokafka reads. Would it be an idea to do
opentelemetry.context.attach(extracted_context)
so that new spans following are created with this linked context?
I can see that in some cases this may not be the desired behaviour, but I'd have thought a very standard pattern would be:
record = get_from_kafka
with span(...):
do stuff
and wanting that do stuff to sit within the parent trace context?
Obviously this is possible manually, I'm trying something like the below, but it would be nice to have some sort of context manager or auto-update which provided this functionality without some hackiness:
record = get_from_kafka
context = propagate.extract(record.headers, getter=_aiokafka_getter)
with tracer.start_as_current_span("process-record", context=context) as span:
...
As I'm not too familiar with the otel api this also would put the process-record span outside of the fetch when it would be nice to group both together - I assume there's a way to update the span context from within a span, but I'm yet to find it.
The text was updated successfully, but these errors were encountered:
In
opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-aiokafka/src/opentelemetry/instrumentation/aiokafka/utils.py
Line 356 in a29ad8a
so that new spans following are created with this linked context?
I can see that in some cases this may not be the desired behaviour, but I'd have thought a very standard pattern would be:
and wanting that
do stuff
to sit within the parent trace context?Obviously this is possible manually, I'm trying something like the below, but it would be nice to have some sort of context manager or auto-update which provided this functionality without some hackiness:
As I'm not too familiar with the otel api this also would put the process-record span outside of the fetch when it would be nice to group both together - I assume there's a way to update the span context from within a span, but I'm yet to find it.
The text was updated successfully, but these errors were encountered: