VictoriaLogs Integration for MongoDB Slow Query Visualization
Reading Guide
It is recommended to follow the order below:
- First read MongoDB Log Rotation to handle log rotation and 0-byte file issues.
- Then choose a deployment method based on your environment:
- Finally, complete the Grafana datasource and slow query dashboard configuration.
The binary deployment option does not include Grafana, so a usable Grafana environment must already be available. The current reference VictoriaLogs datasource plugin version is 0.23.5, and Grafana must be >= 10.4.0. If your Grafana version does not meet this requirement, please first refer to Grafana 12.1.2 Upgrade Steps Reference. The Docker version already includes Grafana and the slow query dashboard, so it can be used directly.
How to Use This Set of Docs
- MongoDB Log Rotation: The prerequisite step for this integration. Handle log rotation and cleanup rules first.
- VictoriaLogs + Promtail Binary Deployment: Suitable for physical machines or VMs, with more manual control retained.
- VictoriaLogs Docker Deployment: Suitable for scenarios where you want to bring up the whole environment with Docker Compose.
Recommended Choice
- If you want to get up and running quickly with fewer environment dependencies, start with the Docker version.
- If your environment already follows a fixed host deployment standard, start with the binary deployment version.
- No matter which option you choose, it is still recommended to finish MongoDB log rotation first before enabling collection and visualization.