-
Notifications
You must be signed in to change notification settings - Fork 694
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
fix(groq): Updated the instrumentation to collect the token histogram #2685
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.
❌ Changes requested. Reviewed everything up to bb8ce0c in 1 minute and 45 seconds
More details
- Looked at
66
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. packages/opentelemetry-instrumentation-groq/opentelemetry/instrumentation/groq/__init__.py:192
- Draft comment:
Usage is accessed immediately without checking if it is None. Guard against None before calling usage.get(). - Reason this comment was not posted:
Comment looked like it was already resolved.
2. packages/opentelemetry-instrumentation-groq/opentelemetry/instrumentation/groq/__init__.py:206
- Draft comment:
Safe-check needed: token_histogram.record is called without verifying if token_histogram is not None. If metrics are disabled (and token_histogram is None), this will raise an exception. Consider adding a guard before calling record. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_B5g1FZrqkqtDXzen
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
packages/opentelemetry-instrumentation-groq/opentelemetry/instrumentation/groq/__init__.py
Outdated
Show resolved
Hide resolved
packages/opentelemetry-instrumentation-groq/opentelemetry/instrumentation/groq/__init__.py
Outdated
Show resolved
Hide resolved
packages/opentelemetry-instrumentation-groq/opentelemetry/instrumentation/groq/__init__.py
Show resolved
Hide resolved
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.
Thanks @adharshctr! Can you address the comments from Elipsis - I think they can actually improve the reliability here :)
Done |
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.
Thanks!
feat(instrumentation): ...
orfix(instrumentation): ...
.Important
Enhances Groq instrumentation by recording token histograms for prompt and completion tokens in
__init__.py
._set_response_attributes
in__init__.py
to record token histogram forprompt_tokens
andcompletion_tokens
.token_histogram
to_set_response_attributes
in_wrap
and_awrap
functions.This description was created by
for bb8ce0c. It will automatically update as commits are pushed.