Hi,
We are planning to use log-based metrics to create counter metrics from application logs or google cloud API logs (such as reported errors for Cloud KMS Decrypt calls), and unless mistaken this is not yet supported in terraform.
I believe such terraform resource would be using the API detailed in https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics
terraform v0.11.4
provider.google v1.8.0
Be able to create at least simple log-based metric counters that would look something like:
resource "google_logging_project_metric" "kms-metric" {
name = "kms-logs-error-metric"
description = "Number of KMS decryption error"
filter = "resource.type=\"cloudkms_cryptokey\" logName=\"projects/${var.google_project_id}/logs/cloudaudit.googleapis.com%2Fdata_access\" protoPayload.status.message: \"denied\""
}
I would also love to see this.
Is anyone already working on this issue?
@danawillow
Not that I know of! Are you looking to contribute?
(do keep in mind if you are, that these days we're trying to generate most new resources using the magic-modules framework)
@danawillow any update on log-based metrics support in terrafrom ?
@danawillow just wanna confirm again , any update on log-based metrics support in terraform ?
@chrisst do you know?
(I'm actually on a break from Terraform at the moment, so I'm afraid tagging me in issues isn't going to be much help)
No updates at this point :( I'll add it to my queue though when I get some time.
Waiting for any updates.
Hello @chrisst, do we have any update on this enhancement support? :)
Hello @chrisst, thanks for checking on this lately. I see a pull request is pending approval on the magic modules repository. Will the update be pushed in this repository once approved? Looking forward to have it soonest.
Yes, Magic Modules is a code generator that we use to build the Terraform Provider Google code base. Once that PR is ready it will generate PR's into all the downstream code bases including this and https://github.com/terraform-providers/terraform-provider-google-beta/
That's good to know @chrisst. Looks like I have to wait for this update. Adding labels via terraform would also be great. :)
We would like to have the ability to create the metric through Terraform. Currently, we validated by creating the manually / sdk and the log based alert policy through Terraform. Please notify when available..
Thanks,
Raj
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 👉 [email protected]. Thanks!
Most helpful comment
No updates at this point :( I'll add it to my queue though when I get some time.