gaogaotiantian / viztracer

VizTracer is a low-overhead logging/debugging/profiling tool that can trace and visualize your python code execution.
https://viztracer.readthedocs.io/
Apache License 2.0
5.17k stars 383 forks source link

Critical OpenTelemetry Bug in v0.17.0 #490

Open naman108 opened 1 week ago

naman108 commented 1 week ago

Any project which depends on opentelemetry's resource module will cause viztracer to silently fail. I tried to debug but whenever I get to the end of the resource module the application simply exits silently. Notably, the code below will succeed with viztracer v0.16.3.

Minimal Reproduction:

from viztracer import VizTracer

tracer = VizTracer()
tracer.start()
try:
    print("starting")
    from opentelemetry.sdk import resources

    # app = DPHelloWorld()
except Exception as e:
    print(e)
finally:
    print("done")
    tracer.stop()
    tracer.save("trace.json")
gaogaotiantian commented 1 week ago

Which OS and Python version are you using? I can't repro this on my macbook with Python 3.12.6.

naman108 commented 1 week ago

Windows 11 in python venv with python 3.12.0, I couldn't find a way to get any logs or a stack trace so I wasn't sure how I could debug.

gaogaotiantian commented 1 week ago

I don't have my windows machine at hand so I'll need to test it later when I'm back home. Do you have other versions of Python? I can test it but it would be nice to have more information - is this 3.12.0 specific because version .0 often has some weird issues.

gaogaotiantian commented 4 days ago

Sorry, I can't reproduce this on Windows either. viztracer==0.17.0 + opentelemetry-sdk==1.28.1 + python 3.12.2. Could you try to upgrade your Python and see if you can still reproduce it?