New-Relic plugin to monitor your google cloud storage activity.
A key point to keep backups in sight !
Check https://github.com/nkcr/Google-Cloud-Storage-Upload to kackup your database on google cloud storage !
- Total size
- Total elements
- Size rate
- Elements rate
- Number of new elements within a day
- Size gained within a day
Google cloud storage
- Google developper account with cloud storage. See https://cloud.google.com/products/cloud-storage/
- Obviously, a google project with a bucket. For help see https://developers.google.com/storage/docs/overview
- Google cloud storage JSON API enabled. See http://s30.postimg.org/oe8wkrc35/Capture_d_cran_2014_06_16_13_14_25.png
- A service account key along with his email address, see http://s4.postimg.org/3nsu1labx/Capture_d_cran_2014_06_16_13_25_13.png
For ubuntu and debian install bundler (and also ruby if needed) with :
$ sudo apt-get install bundler
- Get the plugin folder and place it where you want
Inside the folder run
$ bundle install
This should install the newrelic and google SDK
- Fill the config/newrelic_plugin.yml file :
|google_storage_key_path||The relative path of your service account key|
|google_storage_key_secret||The secret of your key (default is notasecret)|
|google_storage_mail||The email that goes with your service account key, like firstname.lastname@example.org|
|google_storage_project_id||The ID of your google Project (the one that contains your bucket)|
|google_storage_bucket_name||The name of your bucket (the one you wish to monitor)|
|element_offset_alert||Used to monitor the number of new elements per day. That value minus the number of new elements will be the value monitored. Like that we know there is a problem when the value is above the expected one.|
|size_offset_alert||Like element_offset_alert but for the size. If you upload less than a gigabyte per day leave the default value|
And finally, run the script with
$ ruby /path/to/script/folder/newrelic_gcstorage_agent.rb
You can also launch it as a deamon with
$ ./path/to/.../deamon.rb start
On newrelic, alerts only work when a value is above the expected one. To work with it, you can use Alert/elements and Alert/size. Those values work with the ones in the config file : element_offset_alert and size_offset_alert.
Alert/elements is element_offset_alert minus the number of new elements per day. If your expecting 4 new elements per day and element_offset_alert = 100, you will set your alert threshold to 93. The same for size_offset_alert.
Get the source at https://github.com/nkcr/Google-Cloud-Storage-Metric, download it as ZIP file and unzip it on your computer.
Licensed under the The MIT License (MIT).
For any support contact me on github. Please report new issues if found.
The Google cloud storage metrics plugin extends the power of New Relic's monitoring capabilities.
Get This Plugin
Already have a New Relic account? Log in and begin using this plugin.