-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
33 lines (30 loc) · 830 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
variable "project_id" {
description = "The ID of the project in which the resource belongs"
}
locals {
base_filter = ["logName:\"/logs/error\""]
}
resource "google_logging_metric" "error_null_pointer" {
project = var.project_id
name = "error_null_pointer"
filter = join(" AND ", concat(local.base_filter, tolist([
"jsonPayload.code=\"ERROR_NULL_POINTER\""
])))
metric_descriptor {
value_type = "INT64"
unit = "1"
metric_kind = "DELTA"
}
}
resource "google_logging_metric" "warn_data_format_mismatch" {
project = var.project_id
name = "warn_data_format_mismatch"
filter = join(" AND ", concat(local.base_filter, tolist([
"jsonPayload.code=\"WARN_DATA_FORMAT_MISMATCH\""
])))
metric_descriptor {
value_type = "INT64"
unit = "1"
metric_kind = "DELTA"
}
}