Skip to main content
Version: Next 🚧

Metrics reference

Every metric exposed at /metrics, grouped by category. Type is one of gauge, counter, or histogram. Labels are listed in {} after the metric name.

How to read this

For exact emission code, click any metric name (or use the View on GitHub button on referenced code blocks). The Architecture page explains the two-tier scrape model — basic metrics refresh every 30 s, advanced every 5 min by default.

Basic metrics (cheap counts, 30 s refresh)​

Source: src/metrics/basicMetrics.ts.

MetricTypeDescription
librechat_user_countgaugeTotal users (User.countDocuments).
librechat_action_countgaugeTotal actions.
librechat_agent_countgaugeTotal agents.
librechat_assistant_countgaugeTotal assistants.
librechat_balance_countgaugeTotal balance entries.
librechat_banner_countgaugeTotal banners.
librechat_conversation_tag_countgaugeTotal conversation tags.
librechat_conversation_countgaugeTotal conversations.
librechat_file_countgaugeTotal files.
librechat_key_countgaugeTotal API keys stored.
librechat_message_countgaugeTotal messages.
librechat_plugin_auth_countgaugeTotal plugin-auth entries.
librechat_preset_countgaugeTotal presets.
librechat_prompt_group_countgaugeTotal prompt groups.
librechat_prompt_countgaugeTotal prompts.
librechat_session_countgaugeTotal sessions.
librechat_shared_link_countgaugeTotal shared links.
librechat_token_countgaugeTotal token records.
librechat_tool_call_countgaugeTotal tool calls.
librechat_transaction_countgaugeTotal transactions.

Advanced metrics (heavy aggregations, 5 min refresh)​

Source: src/metrics/advancedMetrics.ts. ~60 metrics grouped here.

Users​

MetricTypeLabelsNotes
librechat_active_user_countgauge—Distinct users active in the last 5 minutes.
librechat_unique_user_count_1dgauge—Distinct users active in the last 1 day.
librechat_unique_user_count_7dgauge—Distinct users active in the last 7 days.
librechat_unique_user_count_30dgauge—Distinct users active in the last 30 days.
librechat_active_user_count_by_domaingaugeemail_domainActive users (5 min) bucketed by email domain.
librechat_unique_user_count_1d_by_domain / _7d_by_domain / _30d_by_domaingaugeemail_domainSame buckets at the 1/7/30-day windows.
librechat_user_count_by_email_domaingaugeemail_domainTotal users grouped by email domain.
librechat_user_count_by_rolegaugeroleUsers by role (admin, user, …).
librechat_user_email_verified_percentgauge—Percentage of users with verified emails.
librechat_user_provider_countgaugeproviderUsers by auth provider (google, github, local, …).
librechat_new_users_30dgauge—Users created in the last 30 days.

Messages, tokens, and feedback​

MetricTypeLabelsNotes
librechat_message_token_sumgauge—Sum of tokenCount across all messages.
librechat_message_token_avggauge—Average tokenCount per message.
librechat_error_message_countgauge—Messages flagged with error: true.
librechat_message_with_attachments_countgauge—Messages with non-empty attachments.
librechat_message_plugin_usage_percentgauge—Percentage of messages that invoked a plugin.
librechat_message_feedback_thumbs_up_countgaugetag, modelThumbs-up feedback grouped by feedback.tag and model.
librechat_message_feedback_thumbs_down_countgaugetag, modelThumbs-down equivalent.
librechat_feedback_count_by_taggaugetag, ratingFeedback counts ignoring model.
librechat_feedback_count_by_domain_30dgaugeemail_domain, ratingFeedback by user-domain over the last 30 days.

Conversations​

MetricTypeLabelsNotes
librechat_conversation_length_p50 / _p90 / _p95gauge—Conversation-message-count percentiles. Requires Mongo 7.0+ (troubleshooting).
librechat_conversation_duration_avggauge—Average lifetime of a conversation (created-to-last-message).
librechat_conversation_message_avggauge—Average messages per conversation.
librechat_unfinished_message_countgauge—Messages marked unfinished.

Transactions / costs / tokens​

MetricTypeLabelsNotes
librechat_transaction_token_sumgauge—Sum of token usage across all transactions.
librechat_transaction_token_avggauge—Average tokens per transaction.
librechat_transaction_cost_24h / _7d / _30dgauge—Total USD cost across rolling windows.
librechat_transaction_cost_total_usdgauge—Lifetime total USD cost.
librechat_transaction_cost_sumgaugetokenTypeCost summed per token type (prompt, completion).
librechat_transaction_cost_avggaugetokenTypeAverage cost per token type.
librechat_transaction_cost_per_modelgaugemodelCost per model.
librechat_transaction_cost_by_email_domaingaugeemail_domainCost grouped by user's email domain.
librechat_transaction_cost_by_agentgaugeagentCost grouped by agent.
librechat_cost_per_conversation_avggauge—Average cost per conversation (denominator uses countDocuments so it's tenant-aware).
librechat_transaction_token_sum_by_model_email_domaingaugemodel, tokenType, email_domainPer-domain token usage.
High-cardinality (gated)
librechat_transaction_cost_by_usergaugeidOnly emitted when EMIT_PER_USER_METRICS=true. id is the user's Mongo _id by default, or email when ANONYMIZE_EMAIL_LABEL=false.
librechat_transaction_token_sum_by_model_usergaugemodel, tokenType, idSame gate and same id-label semantics.

Agents / assistants / tools​

MetricTypeLabelsNotes
librechat_agent_usage_countgaugeagentAgent invocation count.
librechat_agent_unique_users_countgaugeagentDistinct users per agent (lifetime).
librechat_agent_unique_users_30dgaugeagentDistinct users per agent in last 30 days.
librechat_agent_last_used_age_secondsgaugeagentSeconds since most recent use.
librechat_agent_avg_messages_per_usegaugeagentAverage messages per conversation, by agent.
librechat_agent_creation_count_by_user_domaingaugeemail_domainAgents created, grouped by author domain.
librechat_agent_usage_by_domain_countgaugeagent, email_domainUsage count per agent + user domain.
librechat_agent_usage_by_user_countgaugeagent, idGated by EMIT_PER_USER_METRICS=true. id is the user's Mongo _id by default, or email when ANONYMIZE_EMAIL_LABEL=false.
librechat_assistant_usage_countgaugeassistantAssistant invocation count.
librechat_model_usage_countgaugemodelPer-model message count.
librechat_tool_call_count_by_toolgaugetoolIdTool-call counts.
librechat_tool_call_avg_latency_secondsgaugetoolIdAverage tool-call latency.

MCP (Model Context Protocol)​

MetricTypeLabelsNotes
librechat_mcp_tool_call_count_30dgauge—Total MCP tool calls in last 30 days.
librechat_mcp_unique_users_by_tool_30dgaugetoolIdDistinct users per MCP tool.
librechat_mcp_tool_call_by_user_domain_30dgaugetoolId, email_domainPer-tool, per-domain breakdown.

Files​

MetricTypeLabelsNotes
librechat_file_count_by_typegaugetypeFiles grouped by MIME type.
librechat_file_total_bytesgauge—Sum of bytes across all files.
librechat_file_avg_bytesgauge—Average file size.
librechat_file_size_p50_bytes / _p95_bytesgauge—File-size percentiles. Requires Mongo 7.0+.
librechat_file_bytes_by_user_domaingaugeemail_domainTotal bytes uploaded, by user domain.
librechat_file_upload_count_24h / _7dgauge—Recent upload counts.

Sessions, prompts, banners​

MetricTypeLabelsNotes
librechat_session_avg_durationgauge—Average session duration (seconds).
librechat_session_active_countgauge—Sessions whose expiration is in the future.
librechat_session_expired_count_24hgauge—Sessions expired in the last 24h.
librechat_prompt_group_count_by_categorygaugecategoryPrompt groups by category.
librechat_prompt_count_by_typegaugetypePrompts by type.
librechat_shared_link_count_24hgauge—Shared links created in last 24h.
librechat_conversation_tag_usage_countgaugetagPer-tag conversation count.
librechat_active_banner_countgauge—Banners currently displayed (between displayFrom / displayTo).

Adoption & periodicity​

MetricTypeLabelsNotes
librechat_adoption_rate_7dgauge—Percentage of recently-created users who returned within 7 days.
librechat_adoption_rate_30dgauge—Same, 30-day window.
librechat_periodicity_dailygauge—Average active days per user per week (last 30 d).
librechat_periodicity_weeklygauge—Average active weeks per user per month (last 30 d).
librechat_periodicity_monthlygauge—Average active months per user (lifetime).
librechat_messages_by_hour_of_daygaugehourMessage volume per hour-of-day bucket.
librechat_messages_by_weekdaygaugeweekdayMessage volume per weekday.
librechat_power_users_count_30dgaugetierDistinct users in each "messages sent" tier (e.g. 1-10, 10-100, …).

Exporter-self metrics​

These describe the exporter itself, not LibreChat. Always emitted.

MetricTypeLabelsNotes
librechat_exporter_mongo_connectedgauge—1 when mongoose readyState === 1, else 0.
librechat_exporter_scrape_duration_secondsgaugemetric_groupDuration of last successful scrape per tier (basic, advanced).
librechat_exporter_scrape_errors_totalcountermetric_groupCumulative scrape errors per tier.
librechat_exporter_last_successful_scrape_timestampgaugemetric_groupUnix timestamp of last success per tier.
librechat_exporter_section_duration_secondshistogramsectionPer-section timings inside advanced (e.g. User map loaded, Transaction Cost Metrics). Trailing parentheticals are stripped to keep cardinality bounded.
librechat_exporter_missing_indexesgaugecollection, key1 when a recommended index is absent on a collection. Asserted at boot from src/metrics/indexAssertions.ts.

Plus the prom-client default metrics (process_*, nodejs_*).