github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/librato/r/space_chart.html.markdown (about) 1 --- 2 layout: "librato" 3 page_title: "Librato: librato_space_chart" 4 sidebar_current: "docs-librato-resource-space-chart" 5 description: |- 6 Provides a Librato Space Chart resource. This can be used to create and manage charts in Librato Spaces. 7 --- 8 9 # librato\_space\_chart 10 11 Provides a Librato Space Chart resource. This can be used to 12 create and manage charts in Librato Spaces. 13 14 ## Example Usage 15 16 ```hcl 17 # Create a new Librato space 18 resource "librato_space" "my_space" { 19 name = "My New Space" 20 } 21 22 # Create a new chart 23 resource "librato_space_chart" "server_temperature" { 24 name = "Server Temperature" 25 space_id = "${librato_space.my_space.id}" 26 27 stream { 28 metric = "server_temp" 29 source = "app1" 30 } 31 32 stream { 33 metric = "environmental_temp" 34 source = "*" 35 group_function = "breakout" 36 summary_function = "average" 37 } 38 39 stream { 40 metric = "server_temp" 41 source = "%" 42 group_function = "average" 43 } 44 } 45 ``` 46 47 ## Argument Reference 48 49 The following arguments are supported: 50 51 * `space_id` - (Required) The ID of the space this chart should be in. 52 * `name` - (Required) The title of the chart when it is displayed. 53 * `type` - (Optional) Indicates the type of chart. Must be one of line or 54 stacked (default to line). 55 * `min` - (Optional) The minimum display value of the chart's Y-axis. 56 * `max` - (Optional) The maximum display value of the chart's Y-axis. 57 * `label` - (Optional) The Y-axis label. 58 * `related_space` - (Optional) The ID of another space to which this chart is 59 related. 60 * `stream` - (Optional) Nested block describing a metric to use for data in the 61 chart. The structure of this block is described below. 62 63 The `stream` block supports: 64 65 * `metric` - (Required) The name of the metric. May not be specified if 66 `composite` is specified. 67 * `source` - (Required) The name of a source, or `*` to include all sources. 68 This field will also accept specific wildcard entries. For example 69 us-west-\*-app will match us-west-21-app but not us-west-12-db. Use % to 70 specify a dynamic source that will be provided after the instrument or 71 dashboard has loaded, or in the URL. May not be specified if `composite` is 72 specified. 73 * `group_function` - (Required) How to process the results when multiple sources 74 will be returned. Value must be one of average, sum, breakout. If average or 75 sum, a single line will be drawn representing the average or sum 76 (respectively) of all sources. If the group_function is breakout, a separate 77 line will be drawn for each source. If this property is not supplied, the 78 behavior will default to average. May not be specified if `composite` is 79 specified. 80 * `composite` - (Required) A composite metric query string to execute when this 81 stream is displayed. May not be specified if `metric`, `source` or 82 `group_function` is specified. 83 * `summary_function` - (Optional) When visualizing complex measurements or a 84 rolled-up measurement, this allows you to choose which statistic to use. 85 Defaults to "average". Valid options are: "max", "min", "average", "sum" or 86 "count". 87 * `name` - (Optional) A display name to use for the stream when generating the 88 tooltip. 89 * `color` - (Optional) Sets a color to use when rendering the stream. Must be a 90 seven character string that represents the hex code of the color e.g. 91 "#52D74C". 92 * `units_short` - (Optional) Unit value string to use as the tooltip label. 93 * `units_long` - (Optional) String value to set as they Y-axis label. All 94 streams that share the same units_long value will be plotted on the same 95 Y-axis. 96 * `min` - (Optional) Theoretical minimum Y-axis value. 97 * `max` - (Optional) Theoretical maximum Y-axis value. 98 * `transform_function` - (Optional) Linear formula to run on each measurement 99 prior to visualization. 100 * `period` - (Optional) An integer value of seconds that defines the period this 101 stream reports at. This aids in the display of the stream and allows the 102 period to be used in stream display transforms. 103 104 ## Attributes Reference 105 106 The following attributes are exported: 107 108 * `id` - The ID of the chart. 109 * `space_id` - The ID of the space this chart should be in. 110 * `title` - The title of the chart when it is displayed.