From c8bd02abee1246a76e3ab5e921ee5ae54f4f5b82 Mon Sep 17 00:00:00 2001 From: Otto Jongerius Date: Mon, 8 Feb 2016 20:00:00 +1100 Subject: [PATCH] Add Datadog doco. --- website/source/assets/stylesheets/_docs.scss | 1 + .../providers/datadog/index.html.markdown | 38 ++++++++ .../providers/datadog/r/monitor.html.markdown | 94 +++++++++++++++++++ website/source/layouts/datadog.erb | 26 +++++ website/source/layouts/docs.erb | 4 + 5 files changed, 163 insertions(+) create mode 100644 website/source/docs/providers/datadog/index.html.markdown create mode 100644 website/source/docs/providers/datadog/r/monitor.html.markdown create mode 100644 website/source/layouts/datadog.erb diff --git a/website/source/assets/stylesheets/_docs.scss b/website/source/assets/stylesheets/_docs.scss index 9737e0f53..c1a6e629d 100755 --- a/website/source/assets/stylesheets/_docs.scss +++ b/website/source/assets/stylesheets/_docs.scss @@ -14,6 +14,7 @@ body.layout-azurerm, body.layout-cloudflare, body.layout-cloudstack, body.layout-consul, +body.layout-datadog, body.layout-digitalocean, body.layout-dme, body.layout-dnsimple, diff --git a/website/source/docs/providers/datadog/index.html.markdown b/website/source/docs/providers/datadog/index.html.markdown new file mode 100644 index 000000000..9e84050fe --- /dev/null +++ b/website/source/docs/providers/datadog/index.html.markdown @@ -0,0 +1,38 @@ +--- +layout: "datadog" +page_title: "Provider: Datadog" +sidebar_current: "docs-datadog-index" +description: |- + The Datadog provider is used to interact with the resources supported by Datadog. The provider needs to be configured with the proper credentials before it can be used. +--- + +# Datadog Provider + +The [Datadog](https://www.datadoghq.com) provider is used to interact with the +resources supported by Datadog. The provider needs to be configured +with the proper credentials before it can be used. + +Use the navigation to the left to read about the available resources. + +## Example Usage + +``` +# Configure the Datadog provider +provider "datadog" { + api_key = "${var.datadog_api_key}" + app_key = "${var.datadog_app_key}" +} + +# Create a new monitor +resource "datadog_monitor" "default" { + ... +} +``` + +## Argument Reference + +The following arguments are supported: + +* `api_key` - (Required) Datadog API key +* `app_key` - (Required) Datadog APP key + diff --git a/website/source/docs/providers/datadog/r/monitor.html.markdown b/website/source/docs/providers/datadog/r/monitor.html.markdown new file mode 100644 index 000000000..e0032888c --- /dev/null +++ b/website/source/docs/providers/datadog/r/monitor.html.markdown @@ -0,0 +1,94 @@ +--- +layout: "datadog" +page_title: "Datadog: datadog_monitor" +sidebar_current: "docs-datadog-resource-monitor" +description: |- + Provides a Datadog monitor resource. This can be used to create and manage monitors. +--- + +# datadog\_monitor + +Provides a Datadog monitor resource. This can be used to create and manage Datadog monitors. + +## Example Usage + +``` +# Create a new Datadog monitor +resource "datadog_monitor" "foo" { + name = "Name for monitor foo" + type = "Metric alert" + message = "Monitor triggered. Notify: @hipchat-channel" + escalation_message = "Escalation message @pagerduty" + + query = "avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo} by {host} > 2" + + thresholds { + ok = 0 + warning = 1 + critical = 2 + } + + notify_no_data = false + renotify_interval = 60 + + notify_audit = false + timeout_h = 60 + include_tags = true + silenced { + "*" = 0 + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `type` - (Required) The type of the monitor, chosen from: + * `metric alert` + * `service check` + * `event alert` + * `query alert` +* `name` - (Required) Name of Datadog monitor +* `query` - (Required) The monitor query to notify on with syntax varying depending on what type of monitor + you are creating. See [API Reference](http://docs.datadoghq.com/api) for options. +* `message` - (Required) A message to include with notifications for this monitor. + Email notifications can be sent to specific users by using the same '@username' notation as events. +* `escalation_message` - (Optional) A message to include with a re-notification. Supports the '@username' + notification allowed elsewhere. +* `thresholds` - (Required) Thresholds by threshold type: + * `ok` + * `warning` + * `critical` +* `notify_no_data` (Optional) A boolean indicating whether this monitor will notify when data stops reporting. Defaults + to false. +* `no_data_timeframe` (Optional) The number of minutes before a monitor will notify when data stops reporting. Must be at + least 2x the monitor timeframe for metric alerts or 2 minutes for service checks. Default: 2x timeframe for + metric alerts, 2 minutes for service checks. +* `renotify_interval` (Optional) The number of minutes after the last notification before a monitor will re-notify + on the current status. It will only re-notify if it's not resolved. +* `notify_audit` (Optional) A boolean indicating whether tagged users will be notified on changes to this monitor. + Defaults to false. +* `timeout_h` (Optional) The number of hours of the monitor not reporting data before it will automatically resolve + from a triggered state. Defaults to false. +* `include_tags` (Optional) A boolean indicating whether notifications from this monitor will automatically insert its + triggering tags into the title. Defaults to true. +* `silenced` (Optional) Each scope will be muted until the given POSIX timestamp or forever if the value is 0. + + To mute the alert completely: + + silenced { + '*' = 0 + } + + To mute role:db for a short time: + + silenced { + 'role:db' = 1412798116 + } + +## Attributes Reference + +The following attributes are exported: + +* `id` - ID of the Datadog monitor diff --git a/website/source/layouts/datadog.erb b/website/source/layouts/datadog.erb new file mode 100644 index 000000000..77f816429 --- /dev/null +++ b/website/source/layouts/datadog.erb @@ -0,0 +1,26 @@ +<% wrap_layout :inner do %> + <% content_for :sidebar do %> + + <% end %> + + <%= yield %> + <% end %> diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index 53b810b19..a000ec6c8 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -158,6 +158,10 @@ Consul + > + Datadog + + > DigitalOcean