Skip to main content

Metrics

Overview of metrics and monitoring in IntelliAsk — the app's built-in Prometheus endpoint and the standalone Metrics Exporter. Points to the full exporter configuration and metrics catalog.

IntelliAsk exposes usage and operational data to Prometheus (or any OpenMetrics-compatible tool) so you can build Grafana dashboards for active users, token usage, models, ratings, and more.

Active users in IntelliAsk

There are two sources of metrics, covering different things:

  • App-side endpoint — the IntelliAsk API server's own /metrics endpoint, covering runtime/HTTP internals (documented below).
  • Metrics Exporter — a separate service (exporter) that reads the MongoDB database and exposes rich intelliask_* usage metrics (users, tokens, models, ratings, tools, files).

Metrics Exporter (usage metrics)

The Metrics Exporter is the recommended way to get usage analytics. It is a bundled, optional stack component — enable it and it scrapes MongoDB and serves intelliask_* metrics for Prometheus to scrape and Grafana to visualize.

Full reference

This page is just an overview. For the exporter's complete configuration (MongoDB connection, caching, per-group metric toggles, logging) and the full catalog of exposed intelliask_* metrics, see Services → Metrics Exporter.

In the stack the exporter runs on container port 8000, published on host port 9100. Point your Prometheus scrape config at it and look for intelliask_* metrics (e.g. intelliask_registered_users).

App-side metrics endpoint

Separately from the exporter, the IntelliAsk API server exposes its own built-in Prometheus metrics at /metrics. Set METRICS_SECRET and scrape the endpoint with Authorization: Bearer <METRICS_SECRET>. The endpoint returns 401 when the secret is unset, the header is missing, or the token does not match.

scrape_configs:
  - job_name: intelliask-api
    scheme: https
    metrics_path: /metrics
    authorization:
      type: Bearer
      credentials: your-metrics-secret
    static_configs:
      - targets: ['intelliask.example.com']

Process, HTTP, and Request Metrics

The endpoint also exposes the default Node.js and process metrics from prom-client, plus the following series.

GroupMetricLabels
HTTPhttp_requests_total, http_request_duration_secondsmethod, path, status
HTTPhttp_requests_in_flight, http_request_body_bytes (from Content-Length)method, path
SSEsse_streams_total, sse_stream_duration_secondsmethod, path, status
SSEsse_streams_in_flightmethod, path
Uploadsupload_requests_total, upload_request_duration_secondsmethod, path, status
Uploadsupload_requests_in_flight, upload_bytes_total (from Content-Length)method, path
OpenIDopenid_user_lookup_total, openid_user_lookup_duration_secondsresult
Mongoosemongoose_queries_total, mongoose_query_duration_secondsmodel, operation, status
Generation jobsgeneration_jobs_totalstore, result
Generation jobsgeneration_jobs_in_flightstore
Generation streamsgeneration_stream_subscriptions_totalstore, type, result
Generation streamsgeneration_stream_resume_pending_events_total, generation_stream_early_buffer_overflows_total, generation_stream_first_attachment_delay_secondsstore
Generation streamsgeneration_stream_attachment_outcomes_totalstore, outcome
Generation streamsgeneration_stream_recoveries_total, generation_stream_recovery_duration_seconds, generation_stream_recovery_events, generation_stream_recovery_content_partsstore, method, outcome
Content filtercontent_filter_locator_traversal_failures_totaloperation, reason
Content filtercontent_filter_locator_traversal_sizeoperation, reason, dimension

The generation stream recovery metrics describe how an early event buffer that overflowed is reconstructed. The content filter metrics count incomplete resolved file locator traversals.

Agent Startup Metrics

Initial Agent chat requests emit two startup metrics:

  • agent_startup_milestone_duration_seconds{milestone} measures cumulative latency from request ingress to each startup milestone.
  • agent_startups_total{result} counts startup attempts by terminal result.

Milestones cover request admission, job creation and acknowledgement, conversation and history loading, client and run initialization, stream startup, and the first queued response or content event. Results distinguish content queued, completion without a content delta, deduplication, rejection, pause, replacement, abort, and error.

When backend OpenTelemetry tracing is enabled, the intelliask.agent.startup span reports the same milestones as events. It includes total startup duration, milestone count, terminal result, and the generation stream ID when one is assigned.

Redis Metrics

Redis-backed caches and services emit two logical-operation metrics:

  • redis_operations_total{client,use_case,operation,status} counts operations.
  • redis_operation_duration_seconds{client,use_case,operation,status} measures latency.

client is keyv or ioredis, and status is success or error. Bounded use_case labels identify work such as caches, sessions, rate limits, concurrency, ACL principals, resumable stream jobs and pub/sub, MCP registry scans, and leader election. These metrics count IntelliAsk's logical operations rather than every internal Redis round trip. Connection lifecycle pings and global maintenance are excluded, and clearing a namespace is counted as one logical operation.

When backend OpenTelemetry tracing is enabled, each HTTP span also summarizes its Redis work with:

  • intelliask.redis.calls
  • intelliask.redis.duration_ms
  • intelliask.redis.errors
  • intelliask.redis.max_call_ms
  • intelliask.redis.operations
  • intelliask.redis.use_cases

The ten use cases with the highest total duration also receive calls, duration_ms, errors, and max_call_ms attributes under intelliask.redis.<use_case>.*. This request-level summary does not require command-level Redis spans; enable OTEL_IOREDIS_TRACING_ENABLED only when individual command spans are needed.

Browser RUM Proxy Metrics

Browser RUM proxy outcomes are reported as rum_proxy_requests_total{endpoint,result}. endpoint is traces, logs, or unknown; result can be success, auth_drop, auth_error, bad_request, not_configured, collector_4xx, collector_5xx, collector_error, or collector_timeout.

Agent Event Actor Metrics

Durable bound Agent Events expose low-cardinality receipt and recovery metrics:

  • agent_event_actor_receipt_operations_total{operation,outcome,resolution} counts receipt reads, settlement, and legacy backfill. operation is read, settle, or backfill; outcome is hit, miss, success, replay, or conflict.
  • agent_event_actor_receipts_retained{resolution} reports replay receipts retained by checkpoint_verified, action_compensated, or history_repaired resolution.
  • agent_event_actor_receipts_expiry_eligible reports retained receipts whose 90-day MongoDB TTL has elapsed but which have not yet been removed.
  • agent_event_actor_reconciliations_pending reports active reconciliation markers waiting for a terminal receipt.
  • agent_event_actor_oldest_reconciliation_age_seconds reports the age of the oldest active reconciliation.
  • agent_event_actor_deliveries{state} reports delivery rows currently in retry or dead state.

Storage gauges are collected on authenticated scrapes and cached for up to 60 seconds. Alert on sustained reconciliation age, dead deliveries, or expiry-eligible receipts rather than a single scrape.

share_link_rejections_total{operation,code} counts bounded create or update failures. operation is create or update; code is TARGET_MESSAGE_NOT_FOUND when the selected branch tail is not persisted, or NO_MESSAGES when the conversation has no persisted messages. The metric contains no conversation text or user identity.

Last updated on