Skip to content

Commit

Permalink
disable logging to datadog by default (#2653)
Browse files Browse the repository at this point in the history
* disable logging to datadog by default

When the logging_datadog section was added in #2519, there was no logging condition applied leading to all requests being logged to datadog.

this adds a "False" condition so that logs are only emitted from the rate limiter

* rename response condition for clarity
  • Loading branch information
ewdurbin authored Nov 7, 2024
1 parent 3ad7b96 commit 452480d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions infra/cdn/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ resource "fastly_service_vcl" "python_org" {
statement = "req.http.host == \"python.org\""
type = "REQUEST"
}
condition {
name = "Always False"
priority = 10
statement = "false"
type = "RESPONSE"
}

condition {
name = "Don't cache 404s for /static"
Expand Down Expand Up @@ -262,9 +268,10 @@ resource "fastly_service_vcl" "python_org" {
}

logging_datadog {
name = "ratelimit-debug"
token = var.datadog_key
region = "US"
name = "ratelimit-debug"
token = var.datadog_key
region = "US"
response_condition = "Always False"
}

logging_s3 {
Expand Down Expand Up @@ -361,7 +368,7 @@ resource "fastly_service_vcl" "python_org" {
dynamic "dictionary" {
for_each = var.activate_ngwaf_service ? [1] : []
content {
name = var.edge_security_dictionary
name = var.edge_security_dictionary
force_destroy = true
}
}
Expand Down

0 comments on commit 452480d

Please sign in to comment.