From 54db417d37401156bdcb5ff53bfdaf9a6234637b Mon Sep 17 00:00:00 2001
From: brettlangdon
Date: Tue, 5 May 2015 09:21:01 -0400
Subject: [PATCH] update docs
---
index.html | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/index.html b/index.html
index 1846c11..6b23cbe 100644
--- a/index.html
+++ b/index.html
@@ -486,7 +486,7 @@ var options = {
dogapi.initialize(options);
var query = "system.cpu.idle{*}";
var to = dogapi.now();
-var from = from - 3600; // an hour ago
+var from = to - 3600; // an hour ago
dogapi.graph.snapshot(query, from, to, function(err, res){
console.dir(res);
});
@@ -1772,15 +1772,28 @@ with the datadog api. The available options are.
app_key: your app key
api_version: the version of the api [default: v1]
api_host: the host to call [default: api.datadoghq.com]
+proxy_agent: Optional, A Https Proxy agent.
var dogapi = require("dogapi");
+
+// Optional for Proxy -------8<----------
+// Code from http://blog.vanamco.com/proxy-requests-in-node-js/
+var HttpsProxyAgent = require("./httpsproxyagent");
+
+var agent = new HttpsProxyAgent({
+ proxyHost: "MY_PROXY_HOST",
+ proxyPort: 3128
+});
+// Optional for Proxy -------->8----------
+
var options = {
api_key: "<API_KEY_HERE>",
- app_key: "<APP_KEY_HERE>"
+ app_key: "<APP_KEY_HERE>",
+ proxy_agent: agent // Optional for Proxy
};
dogapi.initialize(options);
dogapi.event.create(...);