Skip to content

Prometheus metrics

Trackarr exposes a Prometheus scrape endpoint on a dedicated port (default 9090, path /metrics). The endpoint is intentionally separate from the public API so an operator can firewall it independently.

Activation

Env varDefaultPurpose
METRICS_ENABLEDfalseMaster switch. Set to true/1/on to bind the listener.
METRICS_HOST0.0.0.0Bind address.
METRICS_PORT9090Bind port.
METRICS_PATH/metricsScrape path.
METRICS_AUTH_TOKENunsetWhen set, scrapes must present Authorization: Bearer <token> (constant-time compared).
METRICS_PEER_CACHE_MS30000TTL of the cached Redis SCAN over peers:* keys.

A GET /healthz and GET /-/healthy are also served on the same port for orchestrator probes.

Reference

The collector pulls every gauge on each scrape (most are cheap COUNT(*) queries with Promise.allSettled so a slow query can't starve the rest). The Redis swarm SCAN is the only expensive operation and is cached for METRICS_PEER_CACHE_MS.

Content & community

MetricTypeLabelsWhat it tracks
trackarr_users_totalgaugeTotal registered accounts.
trackarr_torrents_totalgaugeTotal torrents indexed (every status, including rejected).
trackarr_torrents_bytes_totalgaugeSum of torrents.size in bytes.
trackarr_forum_topics_totalgaugeForum topics.
trackarr_forum_posts_totalgaugeForum posts (including topic openers).

Swarm (Redis-derived, cached)

MetricTypeWhat it tracks
trackarr_peers_totalgaugeUnique active peers across the swarm.
trackarr_seeders_totalgaugeUnique seeders.
trackarr_leechers_totalgaugeUnique leechers (peers - seeders).

Moderation pipeline

MetricLabels
trackarr_torrents_by_statusstatus="pending|accepted|changes_requested|rejected"
trackarr_torrent_moderation_messages_totalkind="system|staff|user"

The sum of trackarr_torrents_by_status equals trackarr_torrents_total.

Users / governance

MetricLabels
trackarr_users_by_rolerole="admin|moderator|member"
trackarr_users_banned_total
trackarr_roles_totalassignment_mode="manual|auto"
trackarr_user_role_assignments_total

Two-factor auth adoption

MetricTypeNotes
trackarr_users_totp_enabled_totalgaugeAccounts with totp_enabled = true.
trackarr_passkeys_totalgaugeTotal webauthn_credentials rows.
trackarr_users_with_passkey_totalgaugeDistinct user ids carrying ≥1 passkey.
trackarr_recovery_codes_unused_totalgaugeRecovery codes with used_at IS NULL.
trackarr_trusted_devices_active_totalgaugetrusted_devices rows with expires_at > now().
trackarr_require_2fa_scopegauge1 on the active label, 0 on the others. scope="off|staff|all".

Invitations

MetricLabels
trackarr_invitations_pending_total— (legacy, kept for back-compat)
trackarr_invitations_by_statusstatus="pending|used|expired"
trackarr_registration_statemode="open|invite_only|closed" (1 on the active mode)

Bonus events

MetricTypeNotes
trackarr_bonus_events_by_statusgaugestatus="active|scheduled|ended|disabled".
trackarr_bonus_event_activegauge1 if a window is currently in flight, 0 otherwise.
trackarr_bonus_active_download_multipliergaugeRatio (1.0 = identity, 0 = freeleech, 0.5 = silverleech). 1.0 when no event.
trackarr_bonus_active_upload_multipliergaugeSame units. 1.0 when no event.
trackarr_bonus_event_active_ends_at_secondsgaugeUnix epoch seconds. 0 when no event.

Storage / governance

MetricTypeNotes
trackarr_reports_pending_totalgaugeReports awaiting moderator review.
trackarr_hnr_active_totalgaugeHit-and-run rows still on the hook.
trackarr_invitations_pending_totalgaugeUnused, non-expired invitation codes.
trackarr_banned_ips_totalgaugeBanned IPs in the blocklist.
trackarr_redis_memory_bytesgaugeused_memory from Redis INFO.
trackarr_database_size_bytesgaugepg_database_size(current_database()).

Timed bans

MetricTypeNotes
trackarr_users_banned_expiring_totalgaugeSubset of banned users with a banned_until timestamp (timed bans).
trackarr_users_banned_expired_pending_totalgaugeTimed bans whose banned_until has passed but the 5-min cron hasn't swept yet. Sustained values mean the cron is stuck.

Anti-cheat

MetricTypeLabels
trackarr_anticheat_flags_by_kindgaugekind="velocity|no_leecher|unknown_client"
trackarr_anticheat_flags_unreviewed_totalgaugeQueue depth at /mod/anti-cheat.

Social graph

MetricTypeNotes
trackarr_torrent_favorites_totalgaugePer-user torrent stars across the catalogue.
trackarr_user_follows_totalgaugeEdges in the one-way follow graph.
trackarr_torrent_comments_totalgaugeComments posted on torrent detail pages.

Cross-seed

MetricTypeNotes
trackarr_torrents_with_signature_totalgaugeTorrents with a computed content_signature. Useful to track the backfill plugin's progress on a fresh install.

Upload requests (bounty board)

MetricTypeLabels / Notes
trackarr_upload_requests_by_statusgaugestatus="requested|filled|validated|cancelled". Sum = all-time total.
trackarr_upload_requests_reward_held_totalgaugeBonus points held in escrow across open requests (status requested or filled).
trackarr_upload_request_fill_attempts_by_statusgaugestatus="proposed|rejected|validated".
trackarr_upload_request_comments_totalgaugeComments across every request thread (soft-deleted rows included).

Notification routing

MetricTypeLabels
trackarr_notification_routing_subscribersgaugechannel="email|telegram|discord|slack|mattermost|ntfy|gotify|pushover|webhook|apprise|web_push". Distinct subscribers per channel.

Bonus shop

MetricTypeLabels
trackarr_shop_items_by_statusgaugestatus="enabled|disabled"
trackarr_shop_purchases_totalgaugeCumulative successful purchases.

Freeleech pool

The contributory pool: members fund a shared pot until the target is hit, then a sitewide freeleech runs for the configured duration.

MetricTypeLabels / Notes
trackarr_freeleech_pool_enabledgauge1 when the admin has the pool turned on, 0 otherwise.
trackarr_freeleech_pool_points_currentgaugePoints contributed to the open cycle. 0 when no cycle is open.
trackarr_freeleech_pool_points_targetgaugeTarget snapshot of the open cycle.
trackarr_freeleech_pool_progress_ratiogaugecurrent / target, clamped to [0, 1].
trackarr_freeleech_pool_stategaugestate="filling|full_queued|active". 1 on the live one, 0 elsewhere.
trackarr_freeleech_pool_contributors_totalgaugeDistinct contributors in the open cycle.
trackarr_freeleech_pool_cycles_completed_totalgaugeCumulative cycles that ran to completion (status = ended).

Default Node.js metrics

prom-client's default collector ships under the trackarr_ prefix: CPU, heap usage, event-loop lag, GC pauses, etc. (Useful when you want to alert on Node-side trouble.)

Example dashboard queries

promql
# Moderation queue depth (excludes accepted + rejected)
sum by (status) (trackarr_torrents_by_status{status=~"pending|changes_requested"})

# 2FA adoption rate
trackarr_users_totp_enabled_total / trackarr_users_total
trackarr_users_with_passkey_total / trackarr_users_total

# Currently-applied multipliers (plot together; identity when no event)
trackarr_bonus_active_download_multiplier
trackarr_bonus_active_upload_multiplier

# Time until the active bonus event ends
trackarr_bonus_event_active_ends_at_seconds - time()

# Anti-cheat queue health: spikes mean fresh fraud or a stuck mod team
trackarr_anticheat_flags_unreviewed_total

# Cron health: this should stay near 0 — sustained values mean the
# ban-expiry cron isn't sweeping (lock stuck, container unhealthy)
trackarr_users_banned_expired_pending_total

# Bounty board liquidity — how much real bonus mass is committed to
# open requests right now (held in escrow, not spendable elsewhere)
trackarr_upload_requests_reward_held_total

# Backfill progress (should approach trackarr_torrents_total on
# steady state):
trackarr_torrents_with_signature_total / trackarr_torrents_total

# Freeleech-pool fill ratio — pre-clamped 0..1 gauge, plots as a
# smooth ramp from 0% to 100% over the cycle:
trackarr_freeleech_pool_progress_ratio

# Live state of the pool (1 on exactly one label when a cycle is
# open, all zero when no cycle exists):
trackarr_freeleech_pool_state

Released under the MIT License.