-
Notifications
You must be signed in to change notification settings - Fork 754
fix(sdk): Ensure instrumentors don’t report successful init if package isn’t installed #3043
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed everything up to 78aa8a7 in 1 minute and 27 seconds. Click for details.
- Reviewed
469
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
3
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. packages/traceloop-sdk/traceloop/sdk/tracing/tracing.py:143
- Draft comment:
Notice removal of the instrument_set check and warning output. Without this feedback, users may not be alerted when no valid instrumentations are initialized. Confirm this is the intended behavior. - Reason this comment was not posted:
Comment looked like it was already resolved.
2. packages/traceloop-sdk/traceloop/sdk/tracing/tracing.py:507
- Draft comment:
The 'return True' has been moved inside the conditional block for instrumentation (e.g., in init_openai_instrumentor). This means if the instrumentor is already instrumented (or the package isn’t installed), the function returns False. Please verify that returning False in such cases is intended. - Reason this comment was not posted:
Comment looked like it was already resolved.
3. packages/traceloop-sdk/traceloop/sdk/tracing/tracing.py:625
- Draft comment:
Typographical notice: The error message references "Gemini instrumentor" but the function name is init_google_generativeai_instrumentor. If this is not intentional, please update the error message to match the instrumentor's name. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_E8Q7IeL8QibeY2mV
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
except Exception as e: | ||
logging.error(f"Error initializing LanceDB instrumentor: {e}") | ||
Telemetry().log_exception(e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added missing Telemetry().log_exception(e)
if not instrument_set: | ||
print( | ||
Fore.RED + "Warning: No valid instruments set. Remove 'instrument' " | ||
"argument to use all instruments, or set a valid instrument." | ||
) | ||
print(Fore.RESET) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed as duplicate of the following:
openllmetry/packages/traceloop-sdk/traceloop/sdk/tracing/tracing.py
Lines 478 to 485 in 78aa8a7
if not instrument_set: | |
print( | |
Fore.RED | |
+ "Warning: No valid instruments set. " | |
+ "Ensure the instrumented libraries are installed, specify valid instruments, " | |
+ "or remove 'instruments' argument to use all instruments." | |
) | |
print(Fore.RESET) |
feat(instrumentation): ...
orfix(instrumentation): ...
.Fixes #3042
Important
Ensure instrumentors in
tracing.py
don't report successful initialization if the package isn't installed, updatinginit_*_instrumentor()
functions accordingly.tracing.py
don't report successful initialization if the package isn't installed.init_instrumentations()
to print a warning if no valid instruments are set.init_openai_instrumentor()
,init_anthropic_instrumentor()
,init_cohere_instrumentor()
, and 20 otherinit_*_instrumentor()
functions to returnTrue
only if the package is installed and instrumented.instrument_set
check inwrapped_on_end()
intracing.py
.This description was created by
for 78aa8a7. You can customize this summary. It will automatically update as commits are pushed.