Add monitoring for ingest.plausible.io (#3334)

* Add monitoring for ingest.plausible.io

* fix deprecation warning

* fmt
This commit is contained in:
Cenk Kücük 2023-09-11 16:36:08 +02:00 committed by GitHub
parent e30ba8b27f
commit 45ed56b4d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,10 +40,14 @@ resource "checkly_check" "plausible-io-api-health" {
type = "API" type = "API"
activated = true activated = true
frequency = 1 frequency = 1
double_check = true
group_id = checkly_check_group.reachability.id group_id = checkly_check_group.reachability.id
retry_strategy {
type = "FIXED"
max_retries = 2
}
alert_channel_subscription { alert_channel_subscription {
channel_id = checkly_alert_channel.instatus.id channel_id = checkly_alert_channel.instatus.id
activated = true activated = true
@ -79,10 +83,14 @@ resource "checkly_check" "plausible-io-lb-health" {
type = "API" type = "API"
activated = true activated = true
frequency = 1 frequency = 1
double_check = true
group_id = checkly_check_group.reachability.id group_id = checkly_check_group.reachability.id
retry_strategy {
type = "FIXED"
max_retries = 2
}
request { request {
url = "https://ingress.lb.plausible.io/api/health" url = "https://ingress.lb.plausible.io/api/health"
follow_redirects = false follow_redirects = false
@ -113,10 +121,14 @@ resource "checkly_check" "plausible-io-custom-domain-server-health" {
type = "API" type = "API"
activated = true activated = true
frequency = 1 frequency = 1
double_check = true
group_id = checkly_check_group.reachability.id group_id = checkly_check_group.reachability.id
retry_strategy {
type = "FIXED"
max_retries = 2
}
request { request {
url = "https://custom.plausible.io" url = "https://custom.plausible.io"
follow_redirects = false follow_redirects = false
@ -134,9 +146,14 @@ resource "checkly_check" "plausible-io-ingestion" {
type = "API" type = "API"
activated = true activated = true
frequency = 1 frequency = 1
double_check = true
group_id = checkly_check_group.reachability.id group_id = checkly_check_group.reachability.id
retry_strategy {
type = "FIXED"
max_retries = 2
}
request { request {
url = "https://plausible.io/api/event" url = "https://plausible.io/api/event"
follow_redirects = false follow_redirects = false
@ -178,10 +195,14 @@ resource "checkly_check" "plausible-io-tracker-script" {
type = "API" type = "API"
activated = true activated = true
frequency = 1 frequency = 1
double_check = true
group_id = checkly_check_group.reachability.id group_id = checkly_check_group.reachability.id
retry_strategy {
type = "FIXED"
max_retries = 2
}
request { request {
url = "https://plausible.io/js/script.js" url = "https://plausible.io/js/script.js"
follow_redirects = false follow_redirects = false
@ -199,6 +220,54 @@ resource "checkly_check" "plausible-io-tracker-script" {
} }
} }
resource "checkly_check" "ingest-plausible-io-ingestion" {
name = "Check ingest.plausible.io/api/event"
type = "API"
activated = true
frequency = 1
group_id = checkly_check_group.reachability.id
retry_strategy {
type = "FIXED"
max_retries = 2
}
request {
url = "https://ingest.plausible.io/api/event"
follow_redirects = false
skip_ssl = false
method = "POST"
headers = {
User-Agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 OPR/71.0.3770.284"
}
body_type = "JSON"
body = <<EOT
{
"name": "pageview",
"url": "https://internal--checkly.com/",
"domain": "internal--checkly.com",
"width": 1666
}
EOT
assertion {
source = "STATUS_CODE"
comparison = "EQUALS"
target = 202
}
assertion {
source = "TEXT_BODY"
comparison = "EQUALS"
target = "ok"
}
assertion {
source = "HEADERS"
property = "x-plausible-dropped"
comparison = "IS_EMPTY"
}
}
}
resource "checkly_check_group" "reachability" { resource "checkly_check_group" "reachability" {
name = "Reachability probes - via automation" name = "Reachability probes - via automation"
activated = true activated = true
@ -215,9 +284,13 @@ resource "checkly_check_group" "reachability" {
"ap-southeast-2" "ap-southeast-2"
] ]
concurrency = 3 concurrency = 3
double_check = true
use_global_alert_settings = false use_global_alert_settings = false
retry_strategy {
type = "FIXED"
max_retries = 2
}
alert_channel_subscription { alert_channel_subscription {
channel_id = checkly_alert_channel.pagerduty.id channel_id = checkly_alert_channel.pagerduty.id
activated = true activated = true