Skip to content

Commit

Permalink
Update TF provider documentation around template variables (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
carolynblumberg authored Mar 17, 2023
1 parent 4ee625f commit b32f086
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.73.3
1.73.4
18 changes: 6 additions & 12 deletions docs/resources/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ resource "lightstep_dashboard" "customer_charges" {
dashboard_description = "Dashboard for customer charges metrics"
chart {
name = "Requests by Project for $service"
name = "Requests by Project"
rank = 1
type = "timeseries"
query {
hidden = false
query_name = "a"
display = "line"
query_string = "metric requests | filter (service == $service) | rate 10m | group_by [project_id], sum"
query_string = "metric requests | rate 10m | group_by [project_id], sum"
}
}
Expand All @@ -53,12 +53,6 @@ resource "lightstep_dashboard" "customer_charges" {
label {
value = "customlabel"
}
template_variable {
name = "service"
default_values = ["adservice"]
suggestion_attribute_key = "service_name"
}
}
```

Expand All @@ -76,7 +70,7 @@ resource "lightstep_dashboard" "customer_charges" {
- `dashboard_description` (String)
- `group` (Block Set) (see [below for nested schema](#nestedblock--group))
- `label` (Block Set) Labels can be key/value pairs or standalone values. (see [below for nested schema](#nestedblock--label))
- `template_variable` (Block Set) Variable to be used in dashboard queries for dynamically filtering telemetry data (see [below for nested schema](#nestedblock--template_variable))
- `template_variable` (Block Set) [Do not use - this field is not yet supported by the Lightstep SaaS] Variable to be used in dashboard queries for dynamically filtering telemetry data (see [below for nested schema](#nestedblock--template_variable))

### Read-Only

Expand Down Expand Up @@ -230,6 +224,6 @@ Optional:

Required:

- `default_values` (List of String) One or more values to set the template variable to by default (if none are provided, defaults to all possible values)
- `name` (String) Unique (per dashboard) name for template variable, beginning with a letter or underscore and only containing letters, numbers, and underscores
- `suggestion_attribute_key` (String) Attribute key used as source for suggested template variable values appearing in Lightstep UI
- `default_values` (List of String) [Do not use - this field is not yet supported by the Lightstep SaaS] One or more values to set the template variable to by default (if none are provided, defaults to all possible values)
- `name` (String) [Do not use - this field is not yet supported by the Lightstep SaaS] Unique (per dashboard) name for template variable, beginning with a letter or underscore and only containing letters, numbers, and underscores
- `suggestion_attribute_key` (String) [Do not use - this field is not yet supported by the Lightstep SaaS] Attribute key used as source for suggested template variable values appearing in Lightstep UI
8 changes: 4 additions & 4 deletions docs/resources/metric_dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ resource "lightstep_metric_dashboard" "customer_charges" {
- `dashboard_description` (String)
- `group` (Block Set) (see [below for nested schema](#nestedblock--group))
- `label` (Block Set) Labels can be key/value pairs or standalone values. (see [below for nested schema](#nestedblock--label))
- `template_variable` (Block Set) Variable to be used in dashboard queries for dynamically filtering telemetry data (see [below for nested schema](#nestedblock--template_variable))
- `template_variable` (Block Set) [Do not use - this field is not yet supported by the Lightstep SaaS] Variable to be used in dashboard queries for dynamically filtering telemetry data (see [below for nested schema](#nestedblock--template_variable))

### Read-Only

Expand Down Expand Up @@ -310,6 +310,6 @@ Optional:

Required:

- `default_values` (List of String) One or more values to set the template variable to by default (if none are provided, defaults to all possible values)
- `name` (String) Unique (per dashboard) name for template variable, beginning with a letter or underscore and only containing letters, numbers, and underscores
- `suggestion_attribute_key` (String) Attribute key used as source for suggested template variable values appearing in Lightstep UI
- `default_values` (List of String) [Do not use - this field is not yet supported by the Lightstep SaaS] One or more values to set the template variable to by default (if none are provided, defaults to all possible values)
- `name` (String) [Do not use - this field is not yet supported by the Lightstep SaaS] Unique (per dashboard) name for template variable, beginning with a letter or underscore and only containing letters, numbers, and underscores
- `suggestion_attribute_key` (String) [Do not use - this field is not yet supported by the Lightstep SaaS] Attribute key used as source for suggested template variable values appearing in Lightstep UI
8 changes: 4 additions & 4 deletions lightstep/resource_metric_dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func resourceUnifiedDashboard(chartSchemaType ChartSchemaType) *schema.Resource
Elem: &schema.Resource{
Schema: getTemplateVariableSchema(),
},
Description: "Variable to be used in dashboard queries for dynamically filtering telemetry data",
Description: "[Do not use - this field is not yet supported by the Lightstep SaaS] Variable to be used in dashboard queries for dynamically filtering telemetry data",
},
},
}
Expand Down Expand Up @@ -232,20 +232,20 @@ func getTemplateVariableSchema() map[string]*schema.Schema {
"name": {
Type: schema.TypeString,
Required: true,
Description: "Unique (per dashboard) name for template variable, beginning with a letter or underscore and only containing letters, numbers, and underscores",
Description: "[Do not use - this field is not yet supported by the Lightstep SaaS] Unique (per dashboard) name for template variable, beginning with a letter or underscore and only containing letters, numbers, and underscores",
},
"suggestion_attribute_key": {
Type: schema.TypeString,
Required: true,
Description: "Attribute key used as source for suggested template variable values appearing in Lightstep UI",
Description: "[Do not use - this field is not yet supported by the Lightstep SaaS] Attribute key used as source for suggested template variable values appearing in Lightstep UI",
},
"default_values": {
Type: schema.TypeList,
Required: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Description: "One or more values to set the template variable to by default (if none are provided, defaults to all possible values)",
Description: "[Do not use - this field is not yet supported by the Lightstep SaaS] One or more values to set the template variable to by default (if none are provided, defaults to all possible values)",
},
}
}
Expand Down
10 changes: 2 additions & 8 deletions templates/resources/dashboard.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ resource "lightstep_dashboard" "customer_charges" {
dashboard_description = "Dashboard for customer charges metrics"

chart {
name = "Requests by Project for $service"
name = "Requests by Project"
rank = 1
type = "timeseries"

query {
hidden = false
query_name = "a"
display = "line"
query_string = "metric requests | filter (service == $service) | rate 10m | group_by [project_id], sum"
query_string = "metric requests | rate 10m | group_by [project_id], sum"
}
}

Expand All @@ -53,12 +53,6 @@ resource "lightstep_dashboard" "customer_charges" {
label {
value = "customlabel"
}

template_variable {
name = "service"
default_values = ["adservice"]
suggestion_attribute_key = "service_name"
}
}
```

Expand Down

0 comments on commit b32f086

Please sign in to comment.