diff --git a/src/maxmind_db.rs b/src/maxmind_db.rs index 8906246e4a..22f4d41fea 100644 --- a/src/maxmind_db.rs +++ b/src/maxmind_db.rs @@ -68,19 +68,7 @@ impl MaxmindDb { }; match mmdb.lookup::(ip) { - Ok(asn) => { - tracing::info!( - number = asn.r#as, - organization = asn.as_name, - country_code = asn.as_cc, - prefix = asn.prefix, - prefix_entity = asn.prefix_entity, - prefix_name = asn.prefix_name, - "maxmind information" - ); - - Some(asn) - } + Ok(asn) => Some(asn), Err(error) => { tracing::warn!(%ip, %error, "ip not found in maxmind database"); None diff --git a/src/proxy/sessions.rs b/src/proxy/sessions.rs index 300cf74512..bfc9b6d869 100644 --- a/src/proxy/sessions.rs +++ b/src/proxy/sessions.rs @@ -97,6 +97,18 @@ impl Session { tracing::debug!(source = %s.source, dest = ?s.dest, "Session created"); + if let Some(asn) = &s.asn_info { + tracing::debug!( + number = asn.r#as, + organization = asn.as_name, + country_code = asn.as_cc, + prefix = asn.prefix, + prefix_entity = asn.prefix_entity, + prefix_name = asn.prefix_name, + "maxmind information" + ); + } + self::metrics::total_sessions().inc(); s.active_session_metric().inc(); s.run(downstream_socket, shutdown_rx);