Configuration

Metrics

Configuration for metrics.

To enable performance and error measurement of connected services, Directus can provide Prometheus metrics.

VariableDescriptionDefault Value
METRICS_ENABLEDWhether or not to enable metrics.false
METRICS_SCHEDULEThe cron schedule at which to generate the metrics, the default is every minute*/1 * * * *
METRICS_TOKENSA CSV of tokens to allow access to via a Authorization: Metrics <token> header. By default it is restricted to admins--
METRICS_SERVICESA CSV of directus services to observe metrics for. Currently database, cache, redis and storage are supporteddatabase,cache,redis,storage
Metric Aggregation If Directus is running within a PM2 context, then metrics will be aggregated on a per scheduled job frequency. Ensure Prometheus' scrape frequency takes that into account.