Skip to content

Commit

Permalink
google_logging_metric: add disabled argument (#7600)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrFaust92 authored Apr 4, 2023
1 parent 4ed506a commit 8dee8bd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
14 changes: 12 additions & 2 deletions mmv1/products/logging/Metric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

--- !ruby/object:Api::Resource
---
!ruby/object:Api::Resource
name: "Metric"
base_url: projects/{{project}}/metrics
# The % in self_link indicates that the name value should be URL-encoded.
Expand Down Expand Up @@ -51,6 +52,11 @@ examples:
logging_metric_name: "my-(custom)/metric"
test_env_vars:
project: :PROJECT_NAME
- !ruby/object:Provider::Terraform::Examples
name: "logging_metric_disabled"
primary_resource_id: "logging_metric"
vars:
logging_metric_name: "my-(custom)/metric"
custom_code: !ruby/object:Provider::Terraform::CustomCode
custom_import: templates/terraform/custom_import/self_link_as_name.erb
post_create: templates/terraform/post_create/set_computed_name.erb
Expand All @@ -75,6 +81,10 @@ properties:
description: |
The resource name of the Log Bucket that owns the Log Metric. Only Log Buckets in projects
are supported. The bucket has to be in the same project as the metric.
- !ruby/object:Api::Type::Boolean
name: disabled
description: |
If set to True, then this metric is disabled and it does not generate any points.
- !ruby/object:Api::Type::String
name: filter
description: |
Expand Down Expand Up @@ -155,7 +165,7 @@ properties:
required: false
default_value: :STRING
immutable: true
custom_flatten: 'templates/terraform/custom_flatten/default_if_empty.erb'
custom_flatten: "templates/terraform/custom_flatten/default_if_empty.erb"
- !ruby/object:Api::Type::String
name: displayName
description: |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "google_logging_metric" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]["logging_metric_name"] %>"
filter = "resource.type=gae_app AND severity>=ERROR"
metric_descriptor {
metric_kind = "DELTA"
value_type = "INT64"
}
disabled = true
}

0 comments on commit 8dee8bd

Please sign in to comment.