Skip to content

Commit

Permalink
tf(prod): clarify production-site-request-count (#1976)
Browse files Browse the repository at this point in the history
This commit tweaks the log based metric to more specifically
target just incoming requests rather than also error log lines
etc. from nginx

This uses a regex that should match an ipv4, a dash, the possible
- or $remote_user and the [ at the start of the timestamp.

Bug: T385969
  • Loading branch information
tarrow authored Feb 17, 2025
1 parent 0ceb7cc commit 3138b1e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tf/env/production/monitoring.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ resource "google_logging_metric" "production-site-request-count" {
filter = <<-EOT
labels."k8s-pod/app_kubernetes_io/name"="ingress-nginx"
resource.type="k8s_container"
-textPayload:"GoogleStackdriverMonitoring"
-textPayload:"cert-manager"
-textPayload:"Widar"
textPayload=~"^\d*\.\d*\.\d*\.\d*\ - (-|\w) \["
EOT
label_extractors = {
"domain" = "REGEXP_EXTRACT(textPayload, \"\\\\w+ https:\\\\/\\\\/([^\\\\/]+)\")"
Expand Down

0 comments on commit 3138b1e

Please sign in to comment.