Skip to content

Commit

Permalink
Ask Rollbar to log user IPs for us.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchell-as committed Sep 11, 2023
1 parent 8ff3fb2 commit 345879a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions internal/rollbar/rollbar.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ func SetupRollbar(token string) {
data["request"] = map[string]string{}
}
if request, ok := data["request"].(map[string]string); ok {
// Rollbar specially interprets the body["request"]["user_ip"] key, but it does not have to
// actually be an IP address. Use device_id for now. We may want to use real IP later if it
// is easily accessible (Rollbar does not provide it for us with non-http.Request errors).
request["user_ip"] = uniqid.Text()
request["user_ip"] = "$remote_ip" // ask Rollbar to log the user's IP
}
})

Expand Down

0 comments on commit 345879a

Please sign in to comment.