Monitoring Configuration
This guide walks you through configuring LangSmith monitoring for DAIV. LangSmith provides comprehensive observability for your AI agents, including tracing, logging, and performance monitoring.
Prerequisites
Before configuring monitoring, ensure you have:
- DAIV installed and running - Follow the installation guide first
- LangSmith account - Create a free account at smith.langchain.com
- LangSmith API key - Generated from your LangSmith dashboard
Step 1: Create LangSmith API Key
-
Sign in to LangSmith:
-
Go to smith.langchain.com
-
Sign in with your account or create a new one
-
Generate API Key:
-
Navigate to Settings → API Keys
- Click Create API Key
- Name:
DAIV Integration
- Description:
API key for DAIV monitoring
-
Click Create
-
Copy the API Key:
- Important: Copy and save the API key immediately - you won't see it again
- The key format looks like:
lsv2_pt_xxxxxxxxxxxxxxxxxxxxxxxx_yyyyyyyyyyyy
API Key Security
Store your API key securely. Never commit it to version control or share it publicly.
Step 2: Configure Environment Variables
Add your LangSmith configuration to DAIV's environment settings.
For Docker Compose Setup
Edit your docker-compose.yml
file:
YAML | |
---|---|
For Docker Swarm Setup
Environment configuration:
Bash | |
---|---|
Create Docker secret:
Bash | |
---|---|
Using EU Endpoint
If you're in Europe, you may want to use the EU endpoint (default is US):
Bash | |
---|---|
Step 3: Configure Project Settings
Customize your LangSmith project settings for better organization.
Project Names
Use descriptive project names to organize your traces:
Bash | |
---|---|
Step 4: Restart DAIV Services
Apply the new monitoring configuration by restarting DAIV.
For Docker Compose
Bash | |
---|---|
For Docker Swarm
Step 5: Verify Monitoring Setup
Test that LangSmith monitoring is working correctly.
-
Generate Some Activity:
-
Create a test issue in your repository with the
daiv
label - Wait for DAIV to process the issue
-
Or trigger any AI agent activity
-
Check LangSmith Dashboard:
-
Go to smith.langchain.com
- Navigate to your project (e.g.,
daiv-default
) -
You should see traces appearing for agent executions
-
Verify Trace Details:
-
Click on any trace to see detailed execution steps
- Check for proper agent names, model calls, and timing information
Step 6: Dashboard and Analytics
Set up monitoring dashboards and alerts for your DAIV deployment.
Agent Metadata and Tags
Each DAIV agent automatically includes standardized metadata and tags for LangSmith tracing, making it easy to create dashboards and analyze performance:
Standard Tags
All agents include these tags in their traces:
Tag | Description | Example Values |
---|---|---|
Agent Name | The specific agent type | IssueAddressor , PipelineFixer , ReviewAddressor , CodebaseChat , PullRequestDescriber , CodeDescriber , SnippetReplacer , ImageURLExtractor , CodebaseSearch , PlanAndExecute |
Client Slug | The repository client identifier | gitlab , github |
Agent-Specific Metadata
Different agents include additional context-specific metadata:
Issue Addressor (IssueAddressor
):
JSON | |
---|---|
Pipeline Fixer (PipelineFixer
):
JSON | |
---|---|
Review Addressor (ReviewAddressor
):
JSON | |
---|---|
Codebase Chat (CodebaseChat
):
Pull Request Describer (PullRequestDescriber
):
Creating Custom Dashboards
Use these tags and metadata to create focused dashboards:
By Agent Type:
- Filter by tag: IssueAddressor
to see all issue processing activity
- Filter by tag: PipelineFixer
to monitor CI/CD troubleshooting
- Filter by tag: ReviewAddressor
to track code review interactions
By Repository:
- Filter by metadata: source_repo_id
= "your-org/your-repo"
- Group by repo_client
to compare GitLab vs GitHub activity
By User Activity:
- Filter by metadata: author
= "username"
to see user-specific interactions
- Group by author
to identify most active users
By Performance: - Monitor execution time by agent type - Track token usage patterns across different agents - Analyze success/failure rates by agent and repository
Setting Up Alerts
Configure alerts in LangSmith for: - High error rates (> 5%) - Slow response times (> 30 seconds) - Excessive token usage - Failed agent executions
Troubleshooting
Common Issues
No traces appearing in LangSmith:
- Verify API key is correct and has proper permissions
- Check that LANGSMITH_TRACING=true
is set
- Ensure network connectivity to LangSmith endpoints
- Review application logs for authentication errors
Incomplete or missing trace data: - Verify project name matches in all configurations - Check that all required environment variables are set - Ensure Docker secrets are properly mounted (for Swarm deployments)
High costs or token usage: - Review trace filtering settings - Consider disabling tracing for development environments - Monitor token consumption patterns in LangSmith dashboard
Advanced Configuration
Sampling Configuration
Configure trace sampling to reduce costs while maintaining visibility:
⏭️ Next Steps
For more detailed information about LangSmith features, visit the LangSmith documentation.