-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
google_logging_metric resource doesn't allow counter metrics #3698
google_logging_metric resource doesn't allow counter metrics #3698
Comments
Imho the |
Tagging as enhancement because this seems more like new functionality than a bug. |
I was able to create "Counter" metric by setting So the final resource definition that worked: resource "google_logging_metric" "logging_metric" {
name = "my-metric"
filter = "resource.type=gce_instance AND logName:\"logs/syslog\""
project = "my-project"
metric_descriptor {
metric_kind = "DELTA"
value_type = "INT64"
labels {
key = "my_label"
value_type = "STRING"
description = "This is my label"
}
}
label_extractors = {
"my_label" = "REGEXP_EXTRACT(jsonPayload.someField, \"before ([0-9]+) after\")"
}
} And created "Counter" metric: Perhaps this could use some clarification in the docs? |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Community Note
Terraform Version
Terraform v0.11.12
Affected Resource(s)
Terraform Configuration Files
Debug Output
Expected Behavior
A
counter metric
is created, as it is documented here:https://cloud.google.com/logging/docs/logs-based-metrics/counter-metrics
Actual Behavior
The actual resource requires the fields
value_type
andmetrics_kind
which seems that are not required in the case ofcounter metric
.Steps to Reproduce
terraform apply
References
The text was updated successfully, but these errors were encountered: