Monitoring: Make a Google Gratia probe
HAve to decide, and modify the AWSVM probe if necesary, shouldn't be too different.
#5 Updated by Joe Boyd over 3 years ago
For AWS, the gratia-probe-awsvm Gratia probe and the monitoring code for FIFEmon
were almost the same
code written by the same student last summer, Shivakumar Vinayagam.
For Google cloud we have monitoring code written by a summer student but no
gratia probe code yet,
but all the calls you need for the Gratia probe are in that monitoring code.
A major difference between Google and AWS is that the price does not change on
an hour-by-hour basis, there
is one fixed price for the regular instances and a different fixed price for the
so-called "preemptible" instances which can be pre-empted at any time. Another
major difference is that after the first 10 minutes, Google bills in minute
increments. A third major difference is that instances made by the glideinwms
factory are deleted from
the compute instance list immediately when they are terminated, instead of
hanging around for another hour.
Monitoring code we have is in redmine git repository "monitoringaccountingbilling"
you can fetch it by
the interesting stuff is under trunk/src/monitor-gce/bin
Since the code is of similar structure to the gratia-probe-awsvm it should not
be too hard to merge in
the appropriate routines.
You will need to install python 2.7 and the google sdk on any machine you are
testing it on, to make it work.
The Google API calls you will need are described in
API Reference | Compute Engine | Google Cloud Platform
Method HTTP request Description; URIs relative to
https://www.googleapis.com/compute/v1/projects, unless otherwise noted: delete:
DELETE /project/global ...
and the monitoring (Stackdriver) calls you will need are described here:
Stackdriver Monitoring API - Google Cloud Platform
Manages your Stackdriver Monitoring data and configurations. Most projects must
be associated with a Stackdriver account, with a few exceptions as noted on the ...
#6 Updated by Joe Boyd over 3 years ago
Looks like the AWS probe populates these gratia UsageRecord fields:
r = Gratia.UsageRecord()
r.Njobs(1,"The no of jobs running at a time")
r.NodeCount(1) # default to total
Will try to get at least those from GCE and anything else that can be filled into the UsageRecord.