-
Notifications
You must be signed in to change notification settings - Fork 868
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
Add step / task / workflow run / observer metrics as logs #1698
Conversation
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Add logging for step, task, workflow run, and observer metrics, and introduce `prompt_name` for LLM API calls. > > - **Logging Enhancements**: > - Add logging for step duration in `agent.py` when step is completed or failed. > - Add logging for task duration in `agent.py` when task is completed, failed, or terminated. > - Add logging for observer cruise duration in `observer_service.py` when completed. > - Add logging for workflow run duration in `workflow/service.py` when completed. > - **LLM API Handler**: > - Introduce `prompt_name` parameter in `api_handler_factory.py` for LLM API calls to track prompt types. > - Update LLM API handler calls across multiple files to include `prompt_name`. > - **Miscellaneous**: > - Set `include_in_schema=False` for `eval_router` in `app.py` to exclude from schema documentation. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=Skyvern-AI%2Fskyvern-cloud&utm_source=github&utm_medium=referral)<sup> for 5c81904d116acf693dd8a5307ab5e8bc970e7b45. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
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.
👍 Looks good to me! Incremental review on f072cd0 in 1 minute and 11 seconds
More details
- Looked at
954
lines of code in12
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. skyvern/forge/agent.py:1922
- Draft comment:
Usedatetime.now(timezone.utc)
instead ofdatetime.now(UTC)
for getting the current time in UTC. This issue is present in multiple files (e.g.,agent.py
,observer_service.py
,workflow/service.py
). - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
- The comment suggests an alternative way to get UTC time, but both approaches are functionally equivalent.
- The code is already working correctly - UTC from datetime module is the standard way to get UTC timezone.
- Making this change would be purely stylistic and wouldn't improve functionality.
- The comment also mentions this issue exists in other files, but we're only supposed to focus on this file.
The comment does point out a consistent style issue across multiple files. Maybe there's value in standardizing the approach across the codebase?
While consistency is good, this is a minor stylistic preference between two equally valid approaches. The current code is using the standard datetime.UTC constant which is perfectly fine.
Delete this comment. The code is using a valid approach with datetime.UTC, and changing it would be a purely stylistic change with no functional benefit.
Workflow ID: wflow_Jtg3Iuh8NHxAILXv
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
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.
👍 Looks good to me! Reviewed everything up to f072cd0 in 1 minute and 23 seconds
More details
- Looked at
954
lines of code in12
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. skyvern/forge/sdk/routes/agent_protocol.py:1047
- Draft comment:
Theprompt_name
parameter is missing in thisLLM_API_HANDLER
call. Consider adding it for consistency in logging and tracking. - Reason this comment was not posted:
Comment looked like it was already resolved.
2. skyvern/forge/sdk/workflow/models/block.py:1200
- Draft comment:
Theprompt_name
parameter is missing in thisLLM_API_HANDLER
call. Consider adding it for consistency in logging and tracking. - Reason this comment was not posted:
Marked as duplicate.
3. skyvern/forge/sdk/routes/agent_protocol.py:1001
- Draft comment:
Theprompt_name
parameter is missing in thisLLM_API_HANDLER
call. Consider adding it for consistency in logging and tracking. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_ZzArh0Nsv5xoX2NU
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Important
Add logging for step, task, workflow run, and observer metrics, and enhance LLM API calls with
prompt_name
for better tracking.update_step()
inagent.py
when step is completed or failed.update_task()
inagent.py
when task is completed, failed, or terminated.execute_workflow()
inservice.py
when workflow run is completed.mark_observer_task_as_completed()
inobserver_service.py
when completed.llm_api_handler_with_router_and_fallback()
andllm_api_handler()
inapi_handler_factory.py
.prompt_name
parameter to LLM API calls inagent.py
,handler.py
,caching.py
, andobserver_service.py
for better tracking.MAX_STEPS_PER_RUN
from 10 to 75 inconfig.py
.This description was created by
for f072cd0. It will automatically update as commits are pushed.