open-telemetry / opentelemetry-python-contrib

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

Tracing not working python socketio #934

Open dubeamit opened 2 years ago

dubeamit commented 2 years ago

I have a Flask-socketio application which also has flask api's in it. FlaskInstrumentor captures the api traces I also use RequestsInstrumentor to capture the http ping-pong request generated by socketio. But I can't see any traces generated for the socketio

app = Flask(__name__)
socket_ = SocketIO(app, path='/progress', async_mode="threading")

trace.set_tracer_provider(TracerProvider())
trace.get_tracer_provider().add_span_processor(
    BatchSpanProcessor(ConsoleSpanExporter())
)

# auto instrumentor
FlaskInstrumentor().instrument_app(app)
RequestsInstrumentor().instrument()
MySQLInstrumentor().instrument()

tracer = trace.get_tracer(__name__)

Do I have do something else below is installed pypi libraries

python-engineio==3.14.2
python-socketio==4.6.1
Flask-SocketIO==4.3.2
opentelemetry-api==1.9.1
opentelemetry-exporter-otlp==1.9.1
opentelemetry-exporter-otlp-proto-grpc==1.9.1
opentelemetry-exporter-otlp-proto-http==1.9.1
opentelemetry-instrumentation==0.28b1
opentelemetry-instrumentation-dbapi==0.28b1
opentelemetry-instrumentation-flask==0.28b1
opentelemetry-instrumentation-mysql==0.28b1
opentelemetry-instrumentation-requests==0.28b1
opentelemetry-instrumentation-wsgi==0.28b1
opentelemetry-propagator-b3==1.9.1
opentelemetry-proto==1.9.1
opentelemetry-sdk==1.9.1
opentelemetry-semantic-conventions==0.28b1
opentelemetry-util-http==0.28b1
owais commented 2 years ago

We do not have an auto-instrumentation package for socketio right now so this won't work.

owais commented 2 years ago

If anyone wants to work on it, please let me know so I can assign this issue to you.