Skip to content

Commit 02d0994

Browse files
authored
grafana_synthetic_monitoring_probe: Add disable_browser_checks (#1980)
Allows configs to specify browser check support for probes.
1 parent 84124a6 commit 02d0994

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

docs/data-sources/synthetic_monitoring_probe.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ data "grafana_synthetic_monitoring_probe" "atlanta" {
2727

2828
### Read-Only
2929

30+
- `disable_browser_checks` (Boolean) Disables browser checks for this probe.
3031
- `disable_scripted_checks` (Boolean) Disables scripted checks for this probe.
3132
- `id` (String) The ID of the probe.
3233
- `labels` (Map of String) Custom labels to be included with collected metrics and logs.

docs/resources/synthetic_monitoring_probe.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ resource "grafana_synthetic_monitoring_probe" "main" {
4545

4646
### Optional
4747

48+
- `disable_browser_checks` (Boolean) Disables browser checks for this probe. Defaults to `false`.
4849
- `disable_scripted_checks` (Boolean) Disables scripted checks for this probe. Defaults to `false`.
4950
- `labels` (Map of String) Custom labels to be included with collected metrics and logs.
5051
- `public` (Boolean) Public probes are run by Grafana Labs and can be used by all users. Only Grafana Labs managed public probes will be set to `true`. Defaults to `false`.

examples/resources/grafana_synthetic_monitoring_probe/resource_update.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ resource "grafana_synthetic_monitoring_probe" "main" {
77
type = "volcano"
88
}
99
disable_scripted_checks = true
10+
disable_browser_checks = true
1011
}

internal/resources/syntheticmonitoring/resource_probe.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ Grafana Synthetic Monitoring Agent.
107107
Optional: true,
108108
Default: false,
109109
},
110+
"disable_browser_checks": {
111+
Description: "Disables browser checks for this probe.",
112+
Type: schema.TypeBool,
113+
Optional: true,
114+
Default: false,
115+
},
110116
},
111117
}
112118

@@ -184,8 +190,10 @@ func resourceProbeRead(ctx context.Context, d *schema.ResourceData, c *smapi.Cli
184190

185191
if prb.Capabilities != nil {
186192
d.Set("disable_scripted_checks", prb.Capabilities.DisableScriptedChecks)
193+
d.Set("disable_browser_checks", prb.Capabilities.DisableBrowserChecks)
187194
} else {
188195
d.Set("disable_scripted_checks", false)
196+
d.Set("disable_browser_checks", false)
189197
}
190198

191199
return nil
@@ -254,6 +262,7 @@ func makeProbe(d *schema.ResourceData) *sm.Probe {
254262
Public: d.Get("public").(bool),
255263
Capabilities: &sm.Probe_Capabilities{
256264
DisableScriptedChecks: d.Get("disable_scripted_checks").(bool),
265+
DisableBrowserChecks: d.Get("disable_browser_checks").(bool),
257266
},
258267
}
259268
}

internal/resources/syntheticmonitoring/resource_probe_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func TestAccResourceProbe(t *testing.T) {
3636
resource.TestCheckResourceAttr("grafana_synthetic_monitoring_probe.main", "public", "false"),
3737
resource.TestCheckResourceAttr("grafana_synthetic_monitoring_probe.main", "labels.type", "mountain"),
3838
resource.TestCheckResourceAttr("grafana_synthetic_monitoring_probe.main", "disable_scripted_checks", "false"),
39+
resource.TestCheckResourceAttr("grafana_synthetic_monitoring_probe.main", "disable_browser_checks", "false"),
3940
testutils.CheckLister("grafana_synthetic_monitoring_probe.main"),
4041
),
4142
},
@@ -53,6 +54,7 @@ func TestAccResourceProbe(t *testing.T) {
5354
resource.TestCheckResourceAttr("grafana_synthetic_monitoring_probe.main", "public", "false"),
5455
resource.TestCheckResourceAttr("grafana_synthetic_monitoring_probe.main", "labels.type", "volcano"),
5556
resource.TestCheckResourceAttr("grafana_synthetic_monitoring_probe.main", "disable_scripted_checks", "true"),
57+
resource.TestCheckResourceAttr("grafana_synthetic_monitoring_probe.main", "disable_browser_checks", "true"),
5658
),
5759
},
5860
},

0 commit comments

Comments
 (0)