Monitor LangChain Applications
Splunk AppDynamics Python Agent helps you to monitor GenAI apps built using the LangChain framework. When you instrument the app with Python Agent, it captures the following:
- Exit calls to vector databases: pgvector and chroma.
- Prompts and responses in the exit call.
- Counts of documents retrieved, similarity search score, and errors in vector databases
- Calls per minute
To monitor LLMs using LangChain, such as Ollama, the Python Agent records these metrics:
- Tokens
- Prompt count
- Embedding queries count
Prerequisites
Ensure to set the enable-langchain
flag to true
in /path/to/appdynamics.cfg
file of the Python Agent. See [instrumentation]
.
Python agent supports the following versions of LangChain LLMs in Splunk AppDynamics.
Component | Version |
---|---|
langchain
| <= 0.2.11 |
langchain-ollama
| <= 0.2.0 |
langchain-chroma
| <= 0.1.1 |
langchain-postgres
| <= 0.0.12 |
chromadb | <= 0.5.20 |
pgvector | <= 0.2.5 |
Monitor LangChain Ollama APIs
To monitor Ollama calls, the Python Agent reports these metrics:
- Input Tokens
- Output Tokens
- Prompt count
- Embedding queries count
- Errors
For Token Metrics, ensure to install transformers Python library. See transformers.
pip install transformers
Create a Custom Dashboard to Monitor Ollama APIs
Monitor Vectorstores
When you instrument the app with Python Agent, it captures the following for Vectorstores:
- Exit calls to vector databases: pgvector and chroma.
- Counts of documents retrieved, similarity search score, and errors in vector databases
- Calls per minute
To capture Vectorstores request and response in snapshot exit call detail, set the enable-genai-data-capture
flag to true in the /path/to/appdynamics.cfg
file of the Python Agent. See [instrumentation]
.