Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metrics configuration #155

Merged
merged 4 commits into from
Mar 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions content/configuration/16.metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Metrics
description: Configuration for metrics.
---

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

| Variable | Description | Default Value |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| `METRICS_ENABLED` | Whether or not to enable metrics. | `false` |
| `METRICS_SCHEDULE` | The cron schedule at which to generate the metrics, the default is every minute | `*/1 * * * *` |
| `METRICS_TOKENS` | A CSV of tokens to allow access to via a `Authorization: Metrics <token>` header. By default it is restricted to admins | -- |
| `METRICS_SERVICES` | A CSV of directus services to observe metrics for. Currently `database`, `cache`, `redis` and `storage` are supported | `database,cache,redis,storage` |

::: warning 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.

:::