def _request_meta(request):
    """
    Extract relevant meta information from a request instance
    """
    meta = {"ip_address": request.META["REMOTE_ADDR"]}
    if "HTTP_USER_AGENT" in request.META:
        meta["user_agent"] = request.META["HTTP_USER_AGENT"]
    if hasattr(request, "session") and request.session.session_key:
        meta["session"] = request.session.session_key
    return meta