Skip to content
Open
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
40 changes: 40 additions & 0 deletions self-hosting/prometheus-metrics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

<Tip>
For production deployments, keeping Prometheus metrics enabled is strongly recommended for observability, debugging, and performance monitoring.
</Tip>

### 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.
Expand Down