-
Notifications
You must be signed in to change notification settings - Fork 10
Clement/eng 2181 otel exporter #157
Conversation
51602d3 to
95cdb03
Compare
| 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_penaltyare 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
|
|
||
| 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
initializemethod to the clientset_propertiesmethod for customizationHow to test?
Test deprecations
Tests
LITERAL_API_URL="http://localhost:3000" LITERAL_API_KEY="my-initial-api-key" python3 examples/streaming.pyLITERAL_API_URL="http://localhost:3000" LITERAL_API_KEY="my-initial-api-key" python3 examples/langchain_variable.pyLITERAL_API_URL="http://localhost:3000" LITERAL_API_KEY="my-initial-api-key" python3 examples/multimodal.pyLITERAL_API_URL="http://localhost:3000" LITERAL_API_KEY="my-initial-api-key" python3 examples/llamaindex_workflow.py