Grafana MongoDB Atlas Logs Datasource
MongoDB Atlas allows to fetch logs from their service. More information can be found here: https://docs.atlas.mongodb.com/reference/api/logs/
This plugin allows to fetch process, database and disk logs from MongoDB Atlas in your Grafana dashboard. This allows you to monitor your whole MongoDB Atlas infrastructure within your grafana dashboards.
Installation
Important Note: grafana-mongodb-atlas-datasource
is renamed to mongodb-atlas-datasource
. Please update the import command correspondingly or stay with v1
Grafana Setup
You can load the latest plugin version with the following command:
grafana-cli --pluginUrl https://github.com/valiton/grafana-mongodb-atlas-datasource/releases/v2.0.0/download/mongodb-atlas-datasource.zip plugins install mongodb-atlas-datasource
Please note that we currently only build for linux. If you have a windows machine, then you have to update the Makefile accordingly
For docker setup add the following environment variable to automatically install the plugin:
docker run -p 3000:3000 \
-e GF_INSTALL_PLUGINS="https://github.com/valiton/grafana-mongodb-atlas-datasource/releases/download/v2.0.0/mongodb-atlas-datasource.zip;mongodb-atlas-datasource" \
-e "GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=mongodb-atlas-datasource" \
grafana/grafana
For more information about the plugin installation have a look at the plugin official documentation.
Dev setup
This plugin requires node > 8.10 and dep
npm install
dep ensure
make
Usage
Create datasource
After installing the datasource in Grafana (see Grafana Setup section), you can create a Grafana datasource.
Please enter here your Atlas email address and the Atlas API token in the two input fields and click on enter. If the credentials are valid, you will see a green info box. For more information, have a look at the MongoDB Atlas documentation to create these credentials.
Create Panel
After setting up the datasource, you are able to create a query for a Grafana panel. You have to first select here the project you want to monitor and the cluster. After that, you can select one of three different metrics:
- Process logs,
- Database logs and
- Disk logs
Next, you are asked different other parameters, such as the database name and then you can select the dimension you want to display in the query. To name the query, please use the alias
input. You can use {{name}}
to use metrics or dimensions for the name (see hint field of alias
for more information).
Limitations
- Annotations are not supported yet
Contributing
Pull requests for new features, bug fixes, and suggestions are welcome!
Release
1. Add Release Notes to Changelog in README.md
2. Update version in src/plugin.json
3. Update package.json version
4. Create Tag with format vx.y.z
We use semversion format for tagging the releases.´
5. Create Relase Zip
make
zip -r mongodb-atlas-datasource.zip ./dist
6. Create Release with zip files as attachment
see https://help.github.com/en/articles/creating-releases for more information
Changelog
License
MIT