-
Notifications
You must be signed in to change notification settings - Fork 655
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
library-based alternative to opentelemetry-instrument for easy integration in Jupyter notebooks #3263
Comments
added to "alternatives you've considered" We could improve this and document it in the zero-code docs, although technically it is 2 lines of code. Before we do that, it probably should be scrubbed a bit to avoid so many console messages. |
To avoid the warnings, a simple It does seem to require source root in PYTHONPATH (PYTHONPATH= |
This sounds awesome, I'd love to see this. For JS, there is a |
re-jigged the description as yeah if you don't follow other examples in github and do these two things, you can get the intended behavior (at least in a basic example)
|
What problem do you want to solve?
Right now, we have a zero code solution:
opentelemetry-instrument
which is great as it removes the cruft of setting up various components, especially if your instrumentation uses multiple signals like logs, metrics and tracing.However, as this wraps python itself, it presents integration problems which show up in certain scenarios like debuggers and Jupyter notebooks.
Describe the solution you'd like
I would like to see such a "quick start" that works the same as the CLI, but doesn't require bootstrapping python.
Describe alternatives you've considered
I see some code on github doing this:
which is incorrect as it redundantly initializing, and should be like this instead.
However, for this to work you must set PYTHONPATH (e.g.
PYTHONPATH=$PWD dotenv run -- python chat.py
), or you get an error until PR 2886 is resolved.As the import name is neither intuitive, nor documented and has a pending PR to make it usable by default, it isn't yet an ideal solution. If it were (possibly renamed or at least) documented, and the PYTHONPATH glitch cleared, it could close this issue.
Additional Context
3rd party otel SDKs such as openllmetry and langtrace have a library alternative where you include a single initialization comment in your main.py, and that reads ENV variables such as
opentelemetry-instrument
does.langtrace:
openllmetry:
This solves the problem, and I can verify that with the correct settings it works for any OTLP endpoint. However, as you notice these are branded and vendor specific. Also, there are configuration differences as well instrumentation choices.
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: