get_tier2_eligible

Function get_tier2_eligible 

Source
pub(crate) async fn get_tier2_eligible(
    pool: &PgPool,
    since: DateTime<Utc>,
    limit: i64,
) -> Result<Vec<ReflectorRow>, Error>
Expand description

Returns reflectors eligible for Tier 2 monitoring.

Filters for reflectors where tier2_available = true (supports the XLX UDP JSON monitor protocol) AND last_seen >= since (has recent activity). The additional ip_address IS NOT NULL check ensures we have a usable endpoint.

Results are ordered by last_seen DESC and capped at limit rows so the orchestrator can respect its max_concurrent_monitors cap.

ยงErrors

Returns sqlx::Error on query failure.