Monitoring
Monitor your CodeNull AI Backend deployment
Monitoring Your Deployment
Effective monitoring is essential for maintaining a healthy and responsive application. This guide covers how to monitor your CodeNull AI Backend deployment on Azure Container Apps.
Accessing Logs
Azure Container Apps provides built-in logging capabilities that allow you to monitor your application in real-time.
Streaming Logs
To stream logs from your running container app:
This command displays the most recent logs from your application, which is helpful for troubleshooting issues or monitoring application behavior.
Filtering Logs
You can filter the logs to focus on specific information:
The --follow
flag allows you to stream logs in real-time, which is useful during debugging sessions.
Monitoring Application Health
Health Check Endpoint
CodeNull AI Backend provides a built-in health check endpoint that you can use to verify that the application is running correctly:
Example request:
This endpoint returns a status code 200 if the application is healthy. You can also include the mongo_db_check
parameter (default: 1) to verify MongoDB connectivity.
Viewing Deployment Information
To view detailed information about your deployed container app:
This command returns configuration details, including:
- Application URL
- Resource allocation
- Scaling rules
- Environment variables
- Network configuration
Setting Up Azure Monitor (Optional)
For more comprehensive monitoring:
- Navigate to your Container App in the Azure Portal
- Select “Monitoring” from the left navigation
- Configure alerts for metrics like:
- Request count
- Response time
- Error rate
- CPU and memory usage
Recommended Monitoring Practices
- Regular Health Checks: Set up automated health checks to periodically verify your application’s status
- Log Analysis: Review logs regularly to identify potential issues before they affect users
- Performance Monitoring: Track response times and resource usage to optimize your application
- Alert Configuration: Set up alerts for critical metrics to be notified of issues promptly
By following these monitoring practices, you can ensure your CodeNull AI Backend remains reliable and performant.