diff --git a/self-hosting/prometheus-metrics.mdx b/self-hosting/prometheus-metrics.mdx index fdd39cdb..4dc80650 100644 --- a/self-hosting/prometheus-metrics.mdx +++ b/self-hosting/prometheus-metrics.mdx @@ -488,6 +488,46 @@ Measures the performance of converting incoming gRPC requests to HTTP format bef ## Configuration +### Enabling/Disabling Metrics Collection + +**Environment Variable**: `ENABLE_PROMETHEUS` + +**Default**: `true` (enabled) +**Values**: `true` | `false` + +The Portkey Enterprise Gateway allows you to completely disable Prometheus metrics collection if not needed for your deployment. When disabled, both the metrics middleware and the `/metrics` endpoint are deactivated, reducing overhead in environments where Prometheus monitoring is not required. + +**Configuration**: +```bash +# Disable Prometheus metrics (case-insensitive) +ENABLE_PROMETHEUS=false + +# Enable Prometheus metrics (default behavior - can be omitted) +ENABLE_PROMETHEUS=true +``` + +**Behavior**: +- When `ENABLE_PROMETHEUS=false`: + - Metrics middleware is not registered + - The `/metrics` endpoint returns 404 + - No metric collection overhead + - All custom and runtime metrics are disabled + +- When `ENABLE_PROMETHEUS=true` or unset (default): + - Full metrics collection enabled + - `/metrics` endpoint available + - All metrics described in this document are active + +**Use Cases**: +- **Development environments** where metrics are not needed +- **Resource-constrained deployments** to minimize overhead +- **Security-sensitive environments** where metrics exposure is not desired +- **Cost optimization** in serverless or pay-per-use infrastructure + + +For production deployments, keeping Prometheus metrics enabled is strongly recommended for observability, debugging, and performance monitoring. + + ### Dynamic Metadata Label System The Portkey Enterprise Gateway supports dynamic metadata labeling through request-specific metadata injection. This powerful feature enables fine-grained observability across custom dimensions specific to your organization's structure and use cases.