R2r logs
How to Check R2R Logs and Use Analytics & Observability Features
This guide covers various methods to access and analyze R2R logs, as well as leverage R2R’s powerful analytics and observability features. These capabilities allow you to monitor system performance, track usage patterns, and gain valuable insights into your RAG application’s behavior.
1. Checking R2R Logs
1.1 Docker Deployment
If you’re running R2R using Docker:
-
List running containers:
-
View real-time logs:
-
Using Docker Compose:
1.2 Local Deployment
For local deployments without Docker:
- Check the R2R configuration for log file locations.
- Use standard Unix tools to view logs:
1.3 Cloud Deployments
- For Azure: Use “Log stream” or “Diagnose and solve problems” in the Azure portal.
- For AWS: Use CloudWatch or check EC2/ECS logs directly.
2. Using R2R’s Logging and Analytics Features
The features described in this section are typically restricted to superusers. Ensure you have the necessary permissions before attempting to access these features.
2.1 Fetching Logs
You can fetch logs using the client-server architecture:
CLI
Python
JavaScript
Curl
Expected Output:
2.2 Using Analytics
R2R offers an analytics feature for aggregating and analyzing log data:
CLI
Python
JavaScript
Curl
Expected Output:
3. Advanced Analytics and Observability
3.1 Custom Analytics
You can specify different filters and analysis types to focus on specific aspects of your application’s performance:
3.2 Preloading Data for Analysis
To get meaningful analytics, you can preload your database with random searches:
3.3 User-Level Analytics
To get analytics for a specific user:
4. Log Analysis Tips
- Look for ERROR or WARNING level logs first.
- Check timestamps to correlate logs with observed issues.
- Use tools like
grep
,awk
, orsed
to filter logs. - For large log files, use
less
with search functionality.
5. Log Aggregation Tools
Consider using log aggregation tools for more advanced setups:
- ELK Stack (Elasticsearch, Logstash, Kibana)
- Prometheus and Grafana
- Datadog
- Splunk
Summary
R2R’s logging, analytics, and observability features provide powerful tools for understanding and optimizing your RAG application. By leveraging these capabilities, you can:
- Monitor system performance in real-time
- Analyze trends in search and RAG operations
- Identify potential bottlenecks or areas for improvement
- Track user behavior and usage patterns
- Make data-driven decisions to enhance your application’s performance and user experience
Remember to rotate logs regularly and set up log retention policies to manage disk space, especially in production environments.
For more advanced usage and customization options, consider joining the R2R Discord community or referring to the detailed R2R documentation.