Skip to content

Commit

Permalink
add support for comparison_window_ms in dependency maps (#220)
Browse files Browse the repository at this point in the history
* add support for comparison_window_ms

* added terraform docs

---------

Co-authored-by: MisterSquishy <[email protected]>
  • Loading branch information
MisterSquishy and MisterSquishy authored Apr 3, 2024
1 parent df55e0a commit 66a57d8
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
1.93.1
1.93.2

2 changes: 2 additions & 0 deletions docs/resources/alert.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ Optional:

Optional:

- `comparison_window_ms` (Number)
- `display_type` (String)
- `is_donut` (Boolean)
- `sort_by` (String)
Expand Down Expand Up @@ -275,6 +276,7 @@ Optional:

Optional:

- `comparison_window_ms` (Number)
- `display_type` (String)
- `is_donut` (Boolean)
- `sort_by` (String)
Expand Down
2 changes: 2 additions & 0 deletions docs/resources/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ Optional:

Optional:

- `comparison_window_ms` (Number)
- `display_type` (String)
- `is_donut` (Boolean)
- `sort_by` (String)
Expand Down Expand Up @@ -282,6 +283,7 @@ Optional:

Optional:

- `comparison_window_ms` (Number)
- `display_type` (String)
- `is_donut` (Boolean)
- `sort_by` (String)
Expand Down
4 changes: 4 additions & 0 deletions lightstep/resource_dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ func getUnifiedQuerySchemaMap() map[string]*schema.Schema {
Type: schema.TypeBool,
Optional: true,
},
"comparison_window_ms": {
Type: schema.TypeInt,
Optional: true,
},
},
},
Description: "Applicable options vary depending on the display type. Please see the Lightstep documentation for a full description.",
Expand Down
17 changes: 17 additions & 0 deletions lightstep/resource_dashboard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,23 @@ func TestDisplayTypeOptions(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "group.0.chart.0.query.0.display_type_options.0.y_axis_max", "100"),
),
},
{
Config: makeDisplayTypeConfig("dependency_map", strings.TrimSpace(`
display_type_options {
comparison_window_ms = 86400000
}
dependency_map_options {
map_type = "service"
scope = "all"
}
`)),
Check: resource.ComposeTestCheckFunc(
testAccCheckMetricDashboardExists(resourceName, &dashboard),
resource.TestCheckResourceAttr(resourceName, "dashboard_name", "test display_type_options"),
resource.TestCheckResourceAttr(resourceName, "group.0.chart.0.query.0.display", "dependency_map"),
resource.TestCheckResourceAttr(resourceName, "group.0.chart.0.query.0.display_type_options.0.comparison_window_ms", "86400000"),
),
},
},
})
}
Expand Down

0 comments on commit 66a57d8

Please sign in to comment.