Configure Metrics
The metrics block in your config.cap.yaml enables metrics collection for your application. When enabled, CAP will start up a separate copy of your application and register it for scraping so your metrics appear in our monitoring dashboards.
Basic Configuration
metrics:
enable: true
| Property | Type | Description | Default |
|---|---|---|---|
enable |
boolean |
Whether to enable metrics collection. | false |
Metrics Endpoint
If your application exposes metrics on a non-default path, or you want to adjust how often metrics are collected, you can configure that here.
metrics:
enable: true
path: /metrics # Default: /metrics
scrapeInterval: 60s # Default: 60s
| Property | Type | Description | Default |
|---|---|---|---|
path |
string |
The path on your application that exposes metrics. | /metrics |
scrapeInterval |
string |
How frequently metrics are collected from your application. | 60s |
Resource Allocation
The metrics server runs separately from your main application and has its own resource allocation. By default, it inherits the resource settings from the http block if one is configured, otherwise it uses sensible defaults.
metrics:
enable: true
resources:
cpu: 125m
memory: 256Mi
| Property | Type | Description | Default |
|---|---|---|---|
resources.cpu |
string |
CPU allocated to the metrics server. | 125m |
resources.memory |
string |
Memory allocated to the metrics server. | 256Mi |
See the YAML Schema Reference for more details on computeResources syntax.