[Feature Request]: Add Log File Support to Agno for Easier Monitoring & Debugging #2069
Open
2 of 3 tasks
Labels
enhancement
New feature or request
Problem Description
I was comparing the performance of normal chunking methods and agentic chunking methods. While evaluating different packages for production, I explored Agno to measure performance, token usage, and cost analysis. Unlike LangChain, which provides callbacks to track token usage, Agno primarily logs execution traces internally. This made it difficult to retrieve cost-related information directly.
To address this, I modified the
Timer
,Metrics
, andOpenAIChat.response()
functions to capture the total LLM calls and cost calculations. However, Agno currently does not provide an easy way for users to access logs.Since Agno logs everything internally, users should have the option to store logs in a configurable log file for debugging and cost analysis.
Proposed Solution
To improve usability and debugging, I propose adding a file-based logging mechanism to Agno’s logging system. This would allow users to:
Define a custom log file path using the ENV variable
AGNO_LOG_FILE
.If no log file is explicitly set, store logs in the root directory where the package is used.
Code: Modification path:
agno/libs/agno/agno/utils/log.py
Proposed Updation Code:
Alternatives Considered
After reviewing the package, I noticed Agno provides platform-based monitoring for cost and performance tracking. However, it does not expose callbacks for local debugging or detailed execution tracing, unlike LangChain Callbacks https://python.langchain.com/v0.1/docs/modules/callbacks/)
By enabling file-based logging, users can independently monitor token usage, execution time, and cost without relying solely on Agno’s platform.
Additional context
Include any extra information that might be helpful, such as:
Would you like to work on this?
We welcome contributions! Let us know if you’d like to help implement this feature.
The text was updated successfully, but these errors were encountered: