Skip to main content

Prometheus Exporter

The exporter (EXPORTER_* keys) scrapes MongoDB and exposes IntelliAsk usage metrics on host port 9100 for Prometheus. Full env reference, metric-group toggles, the metrics it exposes, and Prometheus/Grafana setup.

The exporter reads IntelliAsk's MongoDB database and exposes Prometheus metrics (usage, tokens, users, models, ratings, tools, files) on host port 9100 — an optional observability component configured entirely through env vars.

Full service reference

This page covers how the exporter is wired into the stack (image, port, and proxy exposure). For the full environment reference and the complete catalog of exposed intelliask_* metrics, see Services → Metrics Exporter.

Overview

Compose fileconfig/exporter.compose.yml
Service nameexporter
Image variableEXPORTER_IMAGE (e.g. intelliask-exporter:2.5.0)
Host port9100 (EXPORTER_PORT) → container 8000
Depends onMongoDB (scrapes it read-only)

Scrape it from Prometheus at http://<vm-host>:9100/metrics.

Configuration

Every exporter setting lives in config/.env and is read by the container under the same name — see Services → Metrics Exporter → Configuration for the full reference (MongoDB, caching, timezone, the per-group metric toggles, and logging) and Services → Metrics Exporter → Metrics for the complete intelliask_* catalog. Defaults are production-ready; on a very large database you can turn off the expensive metric families with the ENABLE_* flags.

After editing any value, apply it with:

intelliask up exporter

Exposing through the proxy

By default the exporter publishes host port 9100. When the bundled reverse proxy is enabled you can instead serve it through Caddy under its own DNS name (with the same TLS mode), keeping the raw port off the public interface. The simplest way is the --exporter-host flag on module enable proxy:

intelliask module enable proxy --exporter-host metrics.example.com
intelliask module enable proxy --no-exporter   # stop fronting it, keep the proxy up

--exporter-host sets the variables below, defaults EXPORTER_BIND=127.0.0.1: (so :9100 stays local-only), re-renders the Caddyfile, and re-applies. You can pass it alongside the other proxy flags, e.g. intelliask module enable proxy --host intelliask.example.com --exporter-host metrics.example.com, and provision offers it interactively. The variables it writes to config/.env:

config/.env keyDefaultPurpose
EXPORTER_PROXY_ENABLEDfalseAdd a Caddy site for the exporter.
EXPORTER_PUBLIC_HOST(empty)Public DNS name for the exporter (e.g. metrics.example.com).
EXPORTER_PROXY_UPSTREAMexporter:8000In-network address Caddy forwards to.
EXPORTER_BIND(empty)Prefix for the host port publish, e.g. 127.0.0.1: to keep 9100 local-only.

You can also set these by hand and re-apply with intelliask up. See Reverse Proxy & TLS for how the extra Caddy site is wired. Scrape it at https://<EXPORTER_PUBLIC_HOST>/metrics instead of http://<vm-host>:9100/metrics.

Prometheus scrape config

Add a job to your prometheus.yml:

scrape_configs:
  - job_name: 'intelliask'
    scrape_interval: 60s
    static_configs:
      - targets: ['<vm-host>:9100']

Resource limits

The exporter is lightweight; the defaults (EXPORTER_CPUS=0.25, EXPORTER_MEMORY=96m) are plenty. Raise them only if you scrape very frequently or keep every expensive metric family on a large database.

Updating the exporter

The exporter is versioned and updated independently of the main app:

# 1. Publish/pull the new build under a new tag, then in config/.env:
#    EXPORTER_IMAGE=intelliask-exporter:2.5.0
 
# 2. Pull + recreate only the exporter
intelliask update exporter

No other service restarts. To roll back, restore the previous EXPORTER_IMAGE tag.

Disabling the exporter

Don't need metrics? Remove exporter.compose.yml from COMPOSE_FILE in config/.env and run intelliask up — the service is dropped and port 9100 is freed. Add it back the same way.

Last updated on