|
| 1 | +--- |
| 2 | +layout: "sysdig" |
| 3 | +page_title: "Sysdig: sysdig_monitor_dashboard" |
| 4 | +sidebar_current: "docs-sysdig-monitor-dashboard" |
| 5 | +description: |- |
| 6 | + Creates a Sysdig Monitor Dashboard. |
| 7 | +--- |
| 8 | + |
| 9 | +# sysdig\_monitor\_dashboard |
| 10 | + |
| 11 | +Creates a Sysdig Monitor Dashboard using PromQL queries. |
| 12 | + |
| 13 | +~> **Note:** This resource is still experimental, and is subject of being changed. |
| 14 | + |
| 15 | +## Example usage |
| 16 | + |
| 17 | +```hcl |
| 18 | +resource "sysdig_monitor_dashboard" "dashboard" { |
| 19 | + name = "Example Dashboard" |
| 20 | + description = "Example Dashboard description" |
| 21 | +
|
| 22 | + panel { |
| 23 | + pos_x = 0 |
| 24 | + pos_y = 0 |
| 25 | + width = 12 # Maximum size: 24 |
| 26 | + height = 6 |
| 27 | + type = "timechart" # timechart or number |
| 28 | + name = "Example panel" |
| 29 | + description = "Description" |
| 30 | +
|
| 31 | + query { |
| 32 | + promql = "avg(avg_over_time(sysdig_host_cpu_used_percent[$__interval]))" |
| 33 | + unit = "percent" |
| 34 | + } |
| 35 | + query { |
| 36 | + promql = "avg(avg_over_time(sysdig_host_cpu_used_percent[$__interval]))" |
| 37 | + unit = "number" |
| 38 | + } |
| 39 | + } |
| 40 | +
|
| 41 | + panel { |
| 42 | + pos_x = 12 |
| 43 | + pos_y = 0 |
| 44 | + width = 12 |
| 45 | + height = 6 |
| 46 | + type = "number" |
| 47 | + name = "example panel - 2" |
| 48 | + description = "description of panel 2" |
| 49 | +
|
| 50 | + query { |
| 51 | + promql = "avg(avg_over_time(sysdig_host_cpu_used_percent[$__interval]))" |
| 52 | + unit = "time" |
| 53 | + } |
| 54 | + } |
| 55 | +} |
| 56 | +``` |
| 57 | + |
| 58 | +## Argument Reference |
| 59 | + |
| 60 | + |
| 61 | +* `name` - (Required) The name of the Dashboard. |
| 62 | + |
| 63 | +* `description` - (Optional) Description of the dashboard. |
| 64 | + |
| 65 | +* `public` - (Optional) Define if the dashboard can be accessible without requiring the user to be logged in. |
| 66 | + |
| 67 | +* `panel` - (Required) At least 1 panel is required to define a Dashboard. |
| 68 | + |
| 69 | +### panel |
| 70 | + |
| 71 | +The whole screen for a dashboard is separated in 24 squares of width. All the panels must not |
| 72 | +overlap with other panels. |
| 73 | +For example, if you position a panel in x: 0, y: 0, and you give it a width of 12, |
| 74 | +then you can position another panel in x: 12, y: 0 with a width of 12. |
| 75 | + |
| 76 | +The following arguments are supported: |
| 77 | + |
| 78 | +* `pos_x` - (Required) Position of the panel in the X axis. Min value: 0, max value: 23. |
| 79 | + |
| 80 | +* `pos_y` - (Required) Position of the panel in the Y axis. Min value: 0. |
| 81 | + |
| 82 | +* `width` - (Required) Width of the panel. Min value: 1, max value: 24. |
| 83 | + |
| 84 | +* `height` - (Required) Height of the panel. Min value: 1. |
| 85 | + |
| 86 | +* `name` - (Required) Name of the panel. |
| 87 | + |
| 88 | +* `description` - (Optional) Description of the panel. |
| 89 | + |
| 90 | +* `type` - (Required) Kind of panel, must be either `timechart` or `number`. |
| 91 | + |
| 92 | +* `query` - (Required) The PromQL query that will show information in the panel. |
| 93 | + If the type of the panel is `timechart`, then it can be specified multiple |
| 94 | + times, to have multiple metrics in the same graph. |
| 95 | + If the type of the panel is `number` then only one can be specified. |
| 96 | + |
| 97 | + |
| 98 | +### query |
| 99 | + |
| 100 | +The following arguments are supported: |
| 101 | + |
| 102 | +* `promql` - (Required) The PromQL query. Must be a valid PromQL query with existing |
| 103 | + metrics in Sysdig Monitor. |
| 104 | + |
| 105 | +* `unit` - (Required) The type of metric for this query. Can be one of: `percent`, `data`, `data rate`, |
| 106 | + `number`, `number rate`, `time`. |
| 107 | + |
| 108 | +## Attributes Reference |
| 109 | + |
| 110 | +In addition to all arguments above, the following attributes are exported: |
| 111 | + |
| 112 | +* `public_token` - (Computed) Token defined when the dashboard is set Public. |
| 113 | + |
| 114 | +* `version` - (Computed) The current version of the Dashboard. |
0 commit comments