Log real client IPs via Fly-Client-IP header (#130)
All checks were successful
Deploy Fly.io Proxy / deploy (push) Successful in 59s
All checks were successful
Deploy Fly.io Proxy / deploy (push) Successful in 59s
## Summary - Add `client_ip` field to the Fly.io nginx JSON log format, sourced from `Fly-Client-IP` header - Extract `client_ip` in the Alloy pipeline so it's available as a parsed field in Loki - Keeps `remote_addr` (the internal proxy IP) for debugging Fixes: Grafana access logs for docs.eblu.me showing 172.16.11.178 for every request instead of real visitor IPs. ## Deployment and Testing - [ ] Deploy updated fly.io proxy: `fly deploy` from `fly/` directory - [ ] Verify in Grafana that new log lines include `client_ip` with real IPs - [ ] Confirm `remote_addr` still shows the proxy IP (preserved for debugging) Reviewed-on: https://forge.ops.eblu.me/eblume/blumeops/pulls/130
This commit is contained in:
parent
92a1081302
commit
3415cad38c
4 changed files with 4 additions and 1 deletions
|
|
@ -24,6 +24,7 @@ loki.process "nginx" {
|
|||
// Parse the JSON log line
|
||||
stage.json {
|
||||
expressions = {
|
||||
client_ip = "client_ip",
|
||||
status = "status",
|
||||
method = "request_method",
|
||||
host = "http_host",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue