diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown new file mode 100644 index 0000000..b80d830 --- /dev/null +++ b/website/docs/index.html.markdown @@ -0,0 +1,39 @@ +--- +layout: "librato" +page_title: "Provider: Librato" +sidebar_current: "docs-librato-index" +description: |- + The Librato provider is used to interact with the resources supported by Librato. The provider needs to be configured with the proper credentials before it can be used. +--- + +# Librato Provider + +The Librato provider is used to interact with the +resources supported by Librato. 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 + +```hcl +# Configure the Librato provider +provider "librato" { + email = "ops@company.com" + token = "${var.librato_token}" +} + +# Create a new space +resource "librato_space" "default" { + # ... +} +``` + +## Argument Reference + +The following arguments are supported: + +* `token` - (Required) Librato API token. It must be provided, but it can also + be sourced from the `LIBRATO_TOKEN` environment variable. +* `email` - (Required) Librato email address. It must be provided, but it can + also be sourced from the `LIBRATO_EMAIL` environment variable. diff --git a/website/docs/r/alert.html.markdown b/website/docs/r/alert.html.markdown new file mode 100644 index 0000000..85dc6a7 --- /dev/null +++ b/website/docs/r/alert.html.markdown @@ -0,0 +1,67 @@ +--- +layout: "librato" +page_title: "Librato: librato_alert" +sidebar_current: "docs-librato-resource-alert" +description: |- + Provides a Librato Alert resource. This can be used to create and manage alerts on Librato. +--- + +# librato\_alert + +Provides a Librato Alert resource. This can be used to +create and manage alerts on Librato. + +## Example Usage + +```hcl +# Create a new Librato alert +resource "librato_alert" "myalert" { + name = "MyAlert" + description = "A Test Alert" + services = ["${librato_service.myservice.id}"] + + condition { + type = "above" + threshold = 10 + metric_name = "librato.cpu.percent.idle" + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) The name of the alert. +* `description` - (Required) Description of the alert. +* `active` - whether the alert is active (can be triggered). Defaults to true. +* `rearm_seconds` - minimum amount of time between sending alert notifications, in seconds. +* `services` - list of notification service IDs. +* `condition` - A trigger condition for the alert. Conditions documented below. +* `attributes` - A hash of additional attribtues for the alert. Attributes documented below. + +## Attributes Reference + +The following attributes are exported: + +* `id` - The ID of the alert. +* `name` - The name of the alert. +* `description` - (Required) Description of the alert. +* `active` - whether the alert is active (can be triggered). Defaults to true. +* `rearm_seconds` - minimum amount of time between sending alert notifications, in seconds. +* `services` - list of notification service IDs. +* `condition` - A trigger condition for the alert. Conditions documented below. + +Conditions (`condition`) support the following: + +* `type` - The type of condition. Must be one of `above`, `below` or `absent`. +* `metric_name`- The name of the metric this alert condition applies to. +* `source`- A source expression which identifies which sources for the given metric to monitor. +* `detect_reset` - boolean: toggles the method used to calculate the delta from the previous sample when the summary_function is `derivative`. +* `duration` - number of seconds condition must be true to fire the alert (required for type `absent`). +* `threshold` - float: measurements over this number will fire the alert (only for `above` or `below`). +* `summary_function` - Indicates which statistic of an aggregated measurement to alert on. ((only for `above` or `below`). + +Attributes (`attributes`) support the following: + +* `runbook_url` - a URL for the runbook to be followed when this alert is firing. Used in the Librato UI if set. diff --git a/website/docs/r/metric.html.markdown b/website/docs/r/metric.html.markdown new file mode 100644 index 0000000..2f2ba9f --- /dev/null +++ b/website/docs/r/metric.html.markdown @@ -0,0 +1,71 @@ +--- +layout: "librato" +page_title: "Librato: librato_metric" +sidebar_current: "docs-librato-resource-metric" +description: |- + Provides a Librato Metric resource. This can be used to create and manage metrics on Librato. +--- + +# librato\_metric + +Provides a Librato Metric resource. This can be used to create and manage metrics on Librato. + +## Example Usage + +```hcl +# Create a new Librato metric +resource "librato_metric" "mymetric" { + name = "MyMetric" + type = "counter" + description = "A Test Metric" + attributes { + display_stacked = true + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `type` - (Required) The type of metric to create (gauge, counter, or composite). +* `name` - (Required) The unique identifier of the metric. +* `display_name` - The name which will be used for the metric when viewing the Metrics website. +* `description` - Text that can be used to explain precisely what the metric is measuring. +* `period` - Number of seconds that is the standard reporting period of the metric. +* `attributes` - The attributes hash configures specific components of a metric’s visualization. +* `composite` - The definition of the composite metric. + +## Attributes Reference + +The following attributes are exported: + +* `name` - The identifier for the metric. +* `display_name` - The name which will be used for the metric when viewing the Metrics website. +* `type` - The type of metric to create (gauge, counter, or composite). +* `description` - Text that describes precisely what the metric is measuring. +* `period` - Number of seconds that is the standard reporting period of the metric. Setting the period enables Metrics to detect abnormal interruptions in reporting and aids in analytics. For gauge metrics that have service-side aggregation enabled, this option will define the period that aggregation occurs on. +* `source_lag` - +* `composite` - The composite definition. Only used when type is composite. + +Attributes (`attributes`) support the following: + +* `color` - Sets a default color to prefer when visually rendering the metric. Must be a seven character string that represents the hex code of the color e.g. #52D74C. +* `display_max` - If a metric has a known theoretical maximum value, set display_max so that visualizations can provide perspective of the current values relative to the maximum value. +* `display_min` - If a metric has a known theoretical minimum value, set display_min so that visualizations can provide perspective of the current values relative to the minimum value. +* `display_units_long` - A string that identifies the unit of measurement e.g. Microseconds. Typically the long form of display_units_short and used in visualizations e.g. the Y-axis label on a graph. +* `display_units_short` - A terse (usually abbreviated) string that identifies the unit of measurement e.g. uS (Microseconds). Typically the short form of display_units_long and used in visualizations e.g. the tooltip for a point on a graph. +* `display_stacked` - A boolean value indicating whether or not multiple metric streams should be aggregated in a visualization (e.g. stacked graphs). By default counters have display_stacked enabled while gauges have it disabled. +* `summarize_function` - Determines how to calculate values when rolling up from raw values to higher resolution intervals. Must be one of: ‘average’, 'sum’, 'count’, 'min’, 'max’. If summarize_function is not set the behavior defaults to average. + +If the values of the measurements to be rolled up are: 2, 10, 5: + +* average: 5.67 +* sum: 17 +* count: 3 +* min: 2 +* max: 10 + +* `aggregate` - Enable service-side aggregation for this metric. When enabled, measurements sent using the same tag set will be aggregated into single measurements on an interval defined by the period of the metric. If there is no period defined for the metric then all measurements will be aggregated on a 60-second interval. + +This option takes a value of true or false. If this option is not set for a metric it will default to false. diff --git a/website/docs/r/service.html.markdown b/website/docs/r/service.html.markdown new file mode 100644 index 0000000..1e579bf --- /dev/null +++ b/website/docs/r/service.html.markdown @@ -0,0 +1,45 @@ +--- +layout: "librato" +page_title: "Librato: librato_service" +sidebar_current: "docs-librato-resource-service" +description: |- + Provides a Librato service resource. This can be used to create and manage notification services on Librato. +--- + +# librato\_service + +Provides a Librato Service resource. This can be used to +create and manage notification services on Librato. + +## Example Usage + +```hcl +# Create a new Librato service +resource "librato_service" "email" { + title = "Email the admins" + type = "mail" + + settings = <