diff --git a/index.html b/index.html index ff619f0..c863c38 100644 --- a/index.html +++ b/index.html @@ -20,6 +20,8 @@ document.addEventListener("DOMContentLoaded", function(){hljs.initHighlightingOn
create an embed graph of a metric query
+The request array to pass create in the embed
+optional, object of extra parameters to pass to the embed create (see options[*] params)
+optional, one of ("1_hour", "4_hours", "1_day", "2_days", and "1_week")
+optional, one of ("small", "medium", "large", "xlarge")
+optional, "yes" or "no"
+optional, the title of the embed
+function(err, res)
+var dogapi = require("dogapi");
+var options = {
+ api_key: "api_key",
+ app_key: "app_key"
+};
+dogapi.initialize(options);
+var query = "system.cpu.idle{*}";
+var graphJSON = {
+ viz: "timeseries",
+ requests: [
+ {
+ q: query,
+ aggregator: "avg",
+ conditional_formats: [],
+ type: "area"
+ }
+ ]
+ }
+var options = {
+ timeframe: "1_hour",
+ size: "xlarge",
+ legend: "yes",
+ title: "my awesome embed"
+};
+dogapi.embed.create(graphJSON, options, function(err, res){
+ console.dir(res);
+});
+
+delete an embed with a specific id
+the id of the embed to delete
+function(err, res)
+var embedid = "foo";
+dogapi.embed.revoke(embedid, function(err, res){
+ console.dir(res);
+});
+
+get all embeds from datadog
+function(err, res)
+dogapi.embed.getAll(function(err, res){
+ console.dir(res);
+});
+
+get a single embed
+the id of the embed to get
+function(err, res)
+var embedId = "foo";
+dogapi.embed.get(embedId, function(err, res){
+ console.dir(res);
+});
+
+create an embed graph of a metric query
-The request array to pass create in the embed
-optional, object of extra parameters to pass to the embed create (see options[*] params)
-optional, one of ("1_hour", "4_hours", "1_day", "2_days", and "1_week")
-optional, one of ("small", "medium", "large", "xlarge")
-optional, "yes" or "no"
-optional, the title of the embed
-function(err, res)
-var dogapi = require("dogapi");
-var options = {
- api_key: "api_key",
- app_key: "app_key"
-};
-dogapi.initialize(options);
-var query = "system.cpu.idle{*}";
-var graphJSON = {
- viz: "timeseries",
- requests: [
- {
- q: query,
- aggregator: "avg",
- conditional_formats: [],
- type: "area"
- }
- ]
- }
-var options = {
- timeframe: "1_hour",
- size: "xlarge",
- legend: "yes",
- title: "my awesome embed"
-};
-dogapi.graph.createEmbed(graphJSON, options, function(err, res){
- console.dir(res);
-});
-
-[timestamp, value] elements (e.g. [[now, 50],
- host: the host source of the metric
- tags: array of "tag:value"'s to use for the metric
-- metric_type|type: which metric type to use ("gauge" or "counter") [default: gauge]
+- metric_type|type: which metric type to use ("gauge" or "count") [default: gauge]
callback
@@ -712,7 +785,7 @@ var now = parseInt(new Date().getTime() / 1000);
dogapi.metric.send("my.metric", [[now, 1000]], function(err, results){
console.dir(results);
});
-dogapi.metric.send("my.counter", 5, {type: "counter"}, function(err, results){
+dogapi.metric.send("my.counter", 5, {type: "count"}, function(err, results){
console.dir(results);
});
@@ -731,7 +804,7 @@ dogapi.metric.send("my.counter", 5, {type: "counter"}, funct
50), an array of data points (e.g. [50, 100]) or an array of [timestamp, value] elements (e.g. [[now, 50], [now, 100]])