-
Notifications
You must be signed in to change notification settings - Fork 3
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
Clement/eng 2181 otel exporter #157
Conversation
51602d3
to
95cdb03
Compare
@@ -119,6 +128,13 @@ def instrument_llamaindex(self): | |||
|
|||
instrument_llamaindex(self.to_sync()) | |||
|
|||
def initialize(self): | |||
with redirect_stdout(io.StringIO()): |
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.
Traceloop is verbose so this is aimed to prevent explicit print
statement.
root_run = active_root_run_var.get() | ||
parent = active_steps_var.get()[-1] if active_steps_var.get() else None | ||
|
||
Traceloop.set_association_properties( |
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.
This is not an upsert so we need to maintain explicit calls.
|
||
Traceloop.set_association_properties( | ||
{ | ||
"literal.thread_id": str(thread.id) if thread else "None", |
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.
Can only store strings
literalai/exporter.py
Outdated
# # TODO: Add generation promptid | ||
# # TODO: Add generation variables | ||
# # TODO: Check missing variables | ||
# # TODO: ttFirstToken | ||
# # TODO: duration | ||
# # TODO: tokenThroughputInSeconds | ||
# # TODO: Add tools | ||
# # TODO: error check with gemini error |
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.
Haven't found a proper way to handle those as of now:
- promptid and variables could be set manually?
- missing variables like
frequency_penalty
are just not tracked by Traceloop so they do not appear in the span attributes, could only found basic support in their issue. - ttFirstToken, duration and tokenThroughputInSeconds could not find a clear alternative
- tools to test
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.
Could not find a way to handle gemini and ttFirstToken
deca886
to
e09d261
Compare
327ffa3
to
1cdace9
Compare
@@ -549,6 +566,21 @@ def __enter__(self) -> Step: | |||
|
|||
if active_root_run_var.get() is None and self.step_type == "run": | |||
active_root_run_var.set(self.step) | |||
Traceloop.set_association_properties( |
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.
if otel is not initialized this wont be an issue?
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.
Yes it can be safely called even without initialization 👍
As discussed yesterday:
|
Changes
initialize
method to the clientset_properties
method for customizationHow to test?
Test deprecations
Tests
LITERAL_API_URL="http://localhost:3000" LITERAL_API_KEY="my-initial-api-key" python3 examples/streaming.py
LITERAL_API_URL="http://localhost:3000" LITERAL_API_KEY="my-initial-api-key" python3 examples/langchain_variable.py
LITERAL_API_URL="http://localhost:3000" LITERAL_API_KEY="my-initial-api-key" python3 examples/multimodal.py
LITERAL_API_URL="http://localhost:3000" LITERAL_API_KEY="my-initial-api-key" python3 examples/llamaindex_workflow.py