|
| 1 | +# Resource: honeycombio_flexible_board |
| 2 | + |
| 3 | +Creates a flexible board. For more information about boards, check out [Create Custom Boards](https://docs.honeycomb.io/observe/boards). |
| 4 | + |
| 5 | +## Example Usage |
| 6 | + |
| 7 | +### Simple Flexible Board |
| 8 | + |
| 9 | +```hcl |
| 10 | +variable "dataset" { |
| 11 | + type = string |
| 12 | +} |
| 13 | +
|
| 14 | +data "honeycombio_query_specification" "latency_by_userid" { |
| 15 | + time_range = 86400 |
| 16 | + breakdowns = ["app.user_id"] |
| 17 | +
|
| 18 | + calculation { |
| 19 | + op = "HEATMAP" |
| 20 | + column = "duration_ms" |
| 21 | + } |
| 22 | +
|
| 23 | + calculation { |
| 24 | + op = "P99" |
| 25 | + column = "duration_ms" |
| 26 | + } |
| 27 | +
|
| 28 | + filter { |
| 29 | + column = "trace.parent_id" |
| 30 | + op = "does-not-exist" |
| 31 | + } |
| 32 | +
|
| 33 | + order { |
| 34 | + column = "duration_ms" |
| 35 | + op = "P99" |
| 36 | + order = "descending" |
| 37 | + } |
| 38 | +
|
| 39 | +} |
| 40 | +
|
| 41 | +resource "honeycombio_query" "latency_by_userid" { |
| 42 | + dataset = var.dataset |
| 43 | + query_json = data.honeycombio_query_specification.latency_by_userid.json |
| 44 | +} |
| 45 | +
|
| 46 | +resource "honeycombio_query_annotation" "latency_by_userid" { |
| 47 | + dataset = var.dataset |
| 48 | + query_id = honeycombio_query.latency_by_userid.id |
| 49 | + name = "Latency by User" |
| 50 | + description = "A breakdown of trace latency by User over the last 24 hours" |
| 51 | +} |
| 52 | +
|
| 53 | +resource "honeycombio_derived_column" "request_latency_sli" { |
| 54 | + alias = "sli.request_latency" |
| 55 | + description = "SLI: request latency less than 300ms" |
| 56 | + dataset = var.dataset |
| 57 | +
|
| 58 | + # heredoc also works |
| 59 | + expression = file("../sli/sli.request_latency.honeycomb") |
| 60 | +
|
| 61 | + lifecycle { |
| 62 | + # in order to avoid potential conflicts with renaming the derived column |
| 63 | + # while in use by the SLO, we set create_before_destroy to true |
| 64 | + create_before_destroy = true |
| 65 | + } |
| 66 | +} |
| 67 | +
|
| 68 | +resource "honeycombio_slo" "slo" { |
| 69 | + name = "Latency SLO" |
| 70 | + description = "example SLO" |
| 71 | + dataset = var.dataset |
| 72 | + sli = honeycombio_derived_column.request_latency_sli.alias |
| 73 | + target_percentage = 99.9 |
| 74 | + time_period = 30 |
| 75 | +
|
| 76 | + tags = { |
| 77 | + team = "web" |
| 78 | + } |
| 79 | +} |
| 80 | +
|
| 81 | +resource "honeycombio_flexible_board" "overview" { |
| 82 | + name = "Service Overview" |
| 83 | + description = "My flexible baord description" |
| 84 | +
|
| 85 | + panel { |
| 86 | + type = "query" |
| 87 | +
|
| 88 | + position { |
| 89 | + x_coordinate = 0 |
| 90 | + y_coordinate = 0 |
| 91 | + width = 6 |
| 92 | + height = 6 |
| 93 | + } |
| 94 | +
|
| 95 | + query_panel { |
| 96 | + query_id = honeycombio_query.latency_by_userid.id |
| 97 | + query_annotation_id = honeycombio_query_annotation.latency_by_userid.id |
| 98 | + query_style = "combo" |
| 99 | + visualization_settings { |
| 100 | + use_utc_xaxis = true |
| 101 | + chart { |
| 102 | + chart_type = "line" |
| 103 | + chart_index = 0 |
| 104 | + omit_missing_values = true |
| 105 | + use_log_scale = true |
| 106 | + } |
| 107 | + } |
| 108 | + } |
| 109 | + } |
| 110 | +
|
| 111 | + panel { |
| 112 | + type = "slo" |
| 113 | + slo_panel { |
| 114 | + slo_id = honeycombio_slo.slo.id |
| 115 | + } |
| 116 | + } |
| 117 | +} |
| 118 | +``` |
| 119 | + |
| 120 | +## Argument Reference |
| 121 | + |
| 122 | +The following arguments are supported for flexible boards: |
| 123 | + |
| 124 | +- `name` - (Required) Name of the board. |
| 125 | +- `description` - (Optional) Description of the board. Supports Markdown. |
| 126 | +- `panel` - (Optional) zero or more configurations blocks |
| 127 | + |
| 128 | +Each board configuration may have zero or more `panel` blocks which accept the following arguments: |
| 129 | + |
| 130 | +- `position` - (Optional) Single configuration block to determine position of the panel. |
| 131 | +- `slo_panel` - (Optional) This is only required for `type` slo panels. Single configuration block that contains board slo information. |
| 132 | +- `query_panel` - (Optional) This is only required for `type` query panels. Single configuration block that contains board query information. |
| 133 | + |
| 134 | +Each `position` configuration accepts the following arguments: |
| 135 | + |
| 136 | +- `x_coordinate` - (Optional) The x-axis origin point for placing the panel within the layout. |
| 137 | +- `y_coordinate` - (Optional) The y-axis origin point for placing the panel within the layout. |
| 138 | +- `width` - (Optional) The width of the panel in honeycomb UI columns. Defaults to 6 for queries and 3 for slos. Maximum value is 12. |
| 139 | +- `height` - (Optional) The height of the panel in rows. Defaults to 4. |
| 140 | + |
| 141 | +Each `slo_panel` configuration accepts the following arguments: |
| 142 | + |
| 143 | +- `slo_id` the ID of the SLO to add to the board. |
| 144 | + |
| 145 | +Each `query_panel` configuration accepts the following arguments: |
| 146 | + |
| 147 | +- `query_id` - (Required) The ID of the Query to show on the board. |
| 148 | +- `query_style` - (Optional) How the query should be displayed within the board, either `graph` (the default), `table` or `combo`. |
| 149 | +- `query_annotation_id` - (Required) The ID of the Query Annotation to associate with this query. |
| 150 | +- `visualization_settings` - (Optional) A configuration block to manage the query visualization and charts. |
| 151 | + |
| 152 | +Each `visualization_settings` configuration accepts the following arguments: |
| 153 | + |
| 154 | +- `use_utc_xaxis` - (Optional) Display UTC Time X-Axis or Localtime X-Axis. |
| 155 | +- `hide_markers` - (Optional) Hide [markers](https://docs.honeycomb.io/investigate/query/customize-results/#markers) from appearing on graph. |
| 156 | +- `hide_hovers` - (Optional) Disable Graph tooltips in the results display when hovering over a graph. |
| 157 | +- `overlaid_charts` - (Optional) Combine any visualized AVG, MIN, MAX, and PERCENTILE clauses into a single chart. |
| 158 | +- `chart` - (Optional) a configuration block to manage the query's charts. |
| 159 | + |
| 160 | +Each `chart` configuration accepts the following arguments: |
| 161 | + |
| 162 | +- `chart_type` - (Optional) the type of chart to render. Some example values: `line`, `tsbar`, `stacked`, `stat`, `tsbar`, `cpie`, `cbar`. Default to `default` |
| 163 | +- `chart_index` - (Optional) index of the charts this configuration corresponds to. |
| 164 | +- `omit_missing_values` - (Optional) Interpolates between points when the intervening time buckets have no matching events. Use to display a continuous line graph with no drops to zero. |
| 165 | +- `use_log_scale` - (Optional) Use logarithmic scale on Y axis. The y-axis of a Log Scale graph increases exponentially. Useful for data with an extremely large range of values. |
| 166 | + |
| 167 | +## Attribute Reference |
| 168 | + |
| 169 | +In addition to all arguments above, the following attributes are exported: |
| 170 | + |
| 171 | +- `id` - ID of the board. |
| 172 | +- `board_url` - The URL to the board in the Honeycomb UI. |
| 173 | + |
| 174 | +## Import |
| 175 | + |
| 176 | +Boards can be imported using their ID, e.g. |
| 177 | + |
| 178 | +```shell |
| 179 | +terraform import honeycombio_flexible_board.my_board AobW9oAZX71 |
| 180 | +``` |
| 181 | + |
| 182 | +You can find the ID in the URL bar when visiting the board from the UI. |
0 commit comments