Test connection and verify metrics
In this milestone, you restart the Grafana Alloy service with the MongoDB configuration and verify that metrics are successfully flowing to Grafana Cloud.
Testing the connection ensures that Grafana Alloy can communicate with both your MongoDB instance and Grafana Cloud, confirming the complete observability pipeline.
To test the connection and verify metrics, complete the following steps:
Save your Grafana Alloy configuration file.
Ensure all changes are saved to
/etc/alloy/config.alloy(Linux),$(brew --prefix)/etc/alloy/config.alloy(macOS), or your custom configuration location.Restart the Grafana Alloy service.
On a Linux machine, run:
sudo systemctl restart alloyOn macOS, run:
brew services restart grafana/grafana/alloyCheck the service status to ensure Alloy is running properly.
On a Linux machine, run:
sudo systemctl status alloyOn macOS, run:
brew services info grafana/grafana/alloyThe output should show
active (running)status.In Grafana Cloud, click Test connection.
It might take up to a few minutes for the system to verify the connection.
You’ll know the connection is working when you see
Integration is collecting data and sending it to Grafana Cloud.Verify metrics are appearing in Grafana Cloud.
- In Grafana Cloud navigate to Explore.
- Select your Prometheus data source.
- Query for MongoDB metrics using:
mongodb_up
If the connection is successful, you should see a value of
1indicating MongoDB is reachable.
In your next milestone, you’ll install the pre-built MongoDB dashboards and alerts.
Please tell us what didn't work:
