Log real client IPs via Fly-Client-IP header #130

Merged
eblume merged 2 commits from fix/real-client-ip-logging into main 2026-02-09 11:02:07 -08:00
Owner

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)
## 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)
The Fly.io edge proxy forwards the original client IP in the
Fly-Client-IP header. Add this as a `client_ip` field in the nginx
JSON log format and extract it in the Alloy pipeline so Loki/Grafana
show real visitor IPs instead of the internal proxy address
(172.16.11.178).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update the Docs APM dashboard's log panel to parse JSON and display
clean formatted lines with client_ip instead of raw JSON blobs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
eblume merged commit 3415cad38c into main 2026-02-09 11:02:07 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
eblume/blumeops!130
No description provided.