Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrumentation for AIOKafka's getmany method #3087

Open
psharrma opened this issue Dec 10, 2024 · 1 comment
Open

Instrumentation for AIOKafka's getmany method #3087

psharrma opened this issue Dec 10, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@psharrma
Copy link

Describe your environment

OS: ALL
Python version: > Python 3.8
Package version: (opentelemetry-instrumentation-aiokafka==0.49b2)

What happened?

I am using faust-streaming as Kafka consumer. It internally uses aioKafka.getmany method.

However it seems AIOKafkaInstrumentor only wraps getone method. Hence the span flow is broken in our application.

Steps to Reproduce

if settings.IS_OPENTELEMETRY_ENABLED:
#Initialise Open Telemetry
resource = Resource(attributes={SERVICE_NAME: settings.PROJECT_NAME})
traceProvider = TracerProvider(resource=resource)
if settings.IS_OPENTELEMETRY_ENABLED:
AIOKafkaInstrumentor().instrument()

    processor = BatchSpanProcessor(OTLPSpanExporter(endpoint=settings.OTLP_URI))
    traceProvider.add_span_processor(processor)
    # Sets the global default tracer provider
    trace.set_tracer_provider(traceProvider)
#End Initialise Open Telemetry

app = faust.App(
'hello-world',
broker='aiokafka://localhost:9092',
value_serializer='raw',
)

greetings_topic = app.topic('greetings')

@app.agent(greetings_topic)
async def greet(greetings):
async for greeting in greetings:
print(greeting)

Expected Result

Should see the span extending till the faust consumer.

Actual Result

Faust Consumer, records it as a new parent span.

Additional context

No response

Would you like to implement a fix?

None

@psharrma psharrma added the bug Something isn't working label Dec 10, 2024
@dimastbk
Copy link
Contributor

Hi. As I see in the source of Faust, getmany is not used. I never worked with Faust, and I suggest asking for help in the new Faust repository, because opentracing feature was implemented in faust-streaming/faust#376.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants