Exporters: - postgres_exporter: DB connections, transactions, cache hit ratio, query stats - node_exporter: host CPU, memory, disk, network - cAdvisor: per-container CPU and memory usage PostgreSQL: - Enable pg_stat_statements for query-level performance tracking - Track index scans vs sequential scans, cache hit ratio Dashboard (service-health.json): - DB: connections, size, transactions/s, slow queries, cache hit ratio, index usage - Host: disk gauge, CPU, memory, network I/O, disk I/O - BRouter: request latency p50/p95/p99, container CPU + memory - All containers: CPU and memory comparison Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
50 lines
1.2 KiB
Caddyfile
50 lines
1.2 KiB
Caddyfile
{
|
|
servers {
|
|
metrics
|
|
}
|
|
admin 0.0.0.0:2019
|
|
}
|
|
|
|
(security_headers) {
|
|
header {
|
|
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
|
X-Content-Type-Options "nosniff"
|
|
X-Frame-Options "DENY"
|
|
Referrer-Policy "strict-origin-when-cross-origin"
|
|
Permissions-Policy "camera=(), microphone=(), geolocation=()"
|
|
Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' blob:; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; img-src 'self' data: https://*.tile.openstreetmap.org; connect-src 'self' wss: https://*.sentry.io https://*.ingest.de.sentry.io; font-src 'self';"
|
|
}
|
|
}
|
|
|
|
(block_scanners) {
|
|
@scanners path /.env* /.git* /wp-* /wp-admin* /admin* /config.* /backup* /.aws* /.docker* /composer* /vendor* *.php *.asp
|
|
respond @scanners 403
|
|
}
|
|
|
|
{$DOMAIN:trails.cool} {
|
|
import security_headers
|
|
import block_scanners
|
|
log {
|
|
output stdout
|
|
format json
|
|
}
|
|
reverse_proxy journal:3000
|
|
}
|
|
|
|
www.{$DOMAIN:trails.cool} {
|
|
redir https://{$DOMAIN:trails.cool}{uri} permanent
|
|
}
|
|
|
|
grafana.internal.{$DOMAIN:trails.cool} {
|
|
reverse_proxy grafana:3000
|
|
}
|
|
|
|
planner.{$DOMAIN:trails.cool} {
|
|
import security_headers
|
|
import block_scanners
|
|
log {
|
|
output stdout
|
|
format json
|
|
}
|
|
reverse_proxy planner:3001
|
|
}
|