Custom Metrics
Overview
Control Plane can collect custom metrics from your workload by having your application emit a Prometheus formatted list of metrics at a path and port of your choosing. The port can be different than the one serving traffic. Each container in a workload can be configured with metrics.
The convention is to use the path /metrics
, but any path can be used.
Sample output from the metrics endpoint:
The platform will scrape all the replicas in the workload every 30 seconds with a 5 second timeout. Metric names with the prefix cpln_
will be ignored by the scrapping process.
The collected metrics can be viewed by clicking the Metrics
link on the workload page within the console. Clear any existing query and enter the name of the metric. Click Run Query
to execute.
The time-series displayed will include these labels:
org
gvc
location
provider
region
cluster_id
replica
Configuring Custom Metrics Scraping
- In the UI, navigate to
Workloads
in the selected GVC and select the workload for which you want to scrape metrics. - Select the appropriate container name under
Containers
, then chooseMetrics
. - Configure the
Path
andPort
where the container serves metrics, then save the settings. - The workload will automatically redeploy to apply the changes. Metrics will be collected once the rollout is complete.
Actions
and selecting Export
.For the configuration schema to use with the API, please refer to the API Reference
in the documentation, under the Workload
section.
For Terraform documentation, click here.
To create dashboards for collected custom metrics, please refer to the Grafana documentation.