-
Notifications
You must be signed in to change notification settings - Fork 765
fix(traceloop-sdk): redefine histogram bucket boundaries #3129
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
feb2eb6
to
943b7f2
Compare
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 feb2eb6 in 1 minute and 42 seconds. Click for details.
- Reviewed
61
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
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/metrics/metrics.py:89
- Draft comment:
Removal of the custom view for LLM_OPERATION_DURATION appears intentional to let the OTel SDK use its default boundaries. Please ensure this removal doesn't break any downstream expectations. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =30%
<= threshold50%
The comment is asking the PR author to ensure that the removal doesn't break any downstream expectations, which violates the rule against asking the author to ensure behavior is intended or tested. However, it does note that the removal appears intentional, which is a valid observation. Overall, the comment leans more towards asking for confirmation rather than providing a specific suggestion or observation.
2. packages/traceloop-sdk/traceloop/sdk/metrics/metrics.py:92
- Draft comment:
Histogram bucket boundaries for LLM_TOKEN_USAGE have been updated to integer values (1, 10, 50, ...). It would help to add an inline comment referencing the python‐contrib definitions for future maintainers. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The comment is about documentation, not a functional issue. The bucket boundaries themselves seem reasonable for token usage (which would naturally be integers). Adding a reference comment would be nice-to-have but not essential. The code is fairly self-explanatory - these are clearly token count boundaries. The comment could be valid if there's an important standard or convention from python-contrib that should be followed. Without seeing the python-contrib reference, we can't be sure if this is important. Even if there is a python-contrib reference, the current code is clear and functional. Documentation suggestions should be more specific if they're truly important. This comment should be deleted as it's a non-essential documentation suggestion that doesn't clearly improve code quality or functionality.
Workflow ID: wflow_ZOiVbnK9ntKlcwCb
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
@@ -88,27 +88,6 @@ def metric_views() -> Sequence[View]: | |||
return [ | |||
View( | |||
instrument_name=Meters.LLM_TOKEN_USAGE, | |||
aggregation=ExplicitBucketHistogramAggregation( |
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.
Should we define a different aggregation?
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.
No. Since we have explicitly specified the boundary values, we should just use ExplicitBucketHistogramAggregation
rather than ExponentialBucketHistogramAggregation
or DefaultAggregation
here.
feat(instrumentation): ...
orfix(instrumentation): ...
.Removed LLM_OPERATION_DURATION to make it use OTel SDK's boundary defaultly. For token we're utilizing the definitions at python-contrib.
Important
Redefines histogram bucket boundaries for
LLM_TOKEN_USAGE
and removes custom boundaries forLLM_OPERATION_DURATION
inmetrics.py
.LLM_OPERATION_DURATION
inmetric_views()
.LLM_TOKEN_USAGE
inmetric_views()
with new values.LLM_OPERATION_DURATION
.This description was created by
for feb2eb6. You can customize this summary. It will automatically update as commits are pushed.