Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

have the magician tag a reviewer for external PRs #4197

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 0 additions & 80 deletions google/resource_logging_metric_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,86 +75,6 @@ resource "google_logging_metric" "logging_metric" {
`, context)
}

func TestAccLoggingMetric_loggingMetricCounterBasicExample(t *testing.T) {
t.Parallel()

context := map[string]interface{}{
"random_suffix": acctest.RandString(10),
}

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckLoggingMetricDestroy,
Steps: []resource.TestStep{
{
Config: testAccLoggingMetric_loggingMetricCounterBasicExample(context),
},
{
ResourceName: "google_logging_metric.logging_metric",
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccLoggingMetric_loggingMetricCounterBasicExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_logging_metric" "logging_metric" {
name = "my-(custom)/metric%{random_suffix}"
filter = "resource.type=gae_app AND severity>=ERROR"
metric_descriptor {
metric_kind = "DELTA"
value_type = "INT64"
}
}
`, context)
}

func TestAccLoggingMetric_loggingMetricCounterLabelsExample(t *testing.T) {
t.Parallel()

context := map[string]interface{}{
"random_suffix": acctest.RandString(10),
}

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckLoggingMetricDestroy,
Steps: []resource.TestStep{
{
Config: testAccLoggingMetric_loggingMetricCounterLabelsExample(context),
},
{
ResourceName: "google_logging_metric.logging_metric",
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccLoggingMetric_loggingMetricCounterLabelsExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_logging_metric" "logging_metric" {
name = "my-(custom)/metric%{random_suffix}"
filter = "resource.type=gae_app AND severity>=ERROR"
metric_descriptor {
metric_kind = "DELTA"
value_type = "INT64"
labels {
key = "mass"
value_type = "STRING"
description = "amount of matter"
}
}
label_extractors = { "mass": "EXTRACT(jsonPayload.request)" }
}
`, context)
}

func testAccCheckLoggingMetricDestroy(s *terraform.State) error {
for name, rs := range s.RootModule().Resources {
if rs.Type != "google_logging_metric" {
Expand Down
44 changes: 0 additions & 44 deletions website/docs/r/logging_metric.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -65,48 +65,6 @@ resource "google_logging_metric" "logging_metric" {
}
}
```
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=logging_metric_counter_basic&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Logging Metric Counter Basic


```hcl
resource "google_logging_metric" "logging_metric" {
name = "my-(custom)/metric"
filter = "resource.type=gae_app AND severity>=ERROR"
metric_descriptor {
metric_kind = "DELTA"
value_type = "INT64"
}
}
```
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=logging_metric_counter_labels&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Logging Metric Counter Labels


```hcl
resource "google_logging_metric" "logging_metric" {
name = "my-(custom)/metric"
filter = "resource.type=gae_app AND severity>=ERROR"
metric_descriptor {
metric_kind = "DELTA"
value_type = "INT64"
labels {
key = "mass"
value_type = "STRING"
description = "amount of matter"
}
}
label_extractors = { "mass": "EXTRACT(jsonPayload.request)" }
}
```

## Argument Reference

Expand Down Expand Up @@ -137,13 +95,11 @@ The `metric_descriptor` block supports:
(Required)
Whether the measurement is an integer, a floating-point number, etc.
Some combinations of metricKind and valueType might not be supported.
For counter metrics, set this to INT64.

* `metric_kind` -
(Required)
Whether the metric records instantaneous values, changes to a value, etc.
Some combinations of metricKind and valueType might not be supported.
For counter metrics, set this to DELTA.

* `labels` -
(Optional)
Expand Down