This is a C# wrapper for the StackDriver Custom Metric API
You will need to include a reference to System.Web.Extensions
Also, if you don't want/use the Amazon Instance Id, you can just remove those lines and run it without reporting the instance id.