This Skill is used to query and manage Volcengine Managed Prometheus (VMP) workspaces, as well as query Prometheus metric data.
When to Use This Skill
When the user requests:
- Query the VMP workspace list
- View workspace details
- Query Prometheus metric data (PromQL query)
- Query metric names and labels
Prerequisites
The Volcengine Python SDK needs to be installed
pip install --upgrade "volcengine-python-sdk>=5.0.21"
Authentication Configuration
It is recommended to configure in ~/.openclaw/workspace/.env :
VOLCENGINE_AK=your_access_key
VOLCENGINE_SK=your_secret_key
VOLCENGINE_REGION=cn-beijing
It can also be set via environment variables:
export VOLCENGINE_AK=your_access_key
export VOLCENGINE_SK=your_secret_key
export VOLCENGINE_REGION=cn-beijing
The authentication reading priority is as follows:
- Process environment variables
--env-pathspecified by.env- Default
.env:~/.openclaw/workspace/.env
Main Supported Features
1. Workspace Management
- Query the workspace list
2. Metrics Query (New)
- Instant query - Use PromQL to query metrics at a single point in time
- Range query - Use PromQL to query metrics over a time range
- Query metric names - Query all metric names in the workspace
- Query metric labels - Query all labels for a specified metric
💡 Tip: For commonly used Volcengine Ark PromQL alert queries, refer to the references/README.md file, which contains 15 commonly used monitoring alert query statements!
Usage Examples
Query the VMP workspace list
python /root/.openclaw/workspace/skills/byted-volcengine-vmp/scripts/list_workspaces.py
Instant Query Metrics (PromQL)
# 查询当前时间的 CPU 使用率
python /root/.openclaw/workspace/skills/byted-volcengine-vmp/scripts/query_metrics.py \
--workspace-id <workspace-id> \
--query "sum(rate(container_cpu_usage_seconds_total[5m]))"
Range Query Metrics (time range)
# 查询最近 1 小时的 CPU 使用率
python /root/.openclaw/workspace/skills/byted-volcengine-vmp/scripts/query_range_metrics.py \
--workspace-id <workspace-id> \
--query "sum(rate(container_cpu_usage_seconds_total[5m]))" \
--start "2026-04-06T20:00:00+08:00" \
--end "2026-04-06T21:00:00+08:00"
Query the metric name list
# 查询工作区中的所有指标名称
python /root/.openclaw/workspace/skills/byted-volcengine-vmp/scripts/get_metric_names.py \
--workspace-id <workspace-id>
# 带匹配条件查询
python /root/.openclaw/workspace/skills/byted-volcengine-vmp/scripts/get_metric_names.py \
--workspace-id <workspace-id> \
--match '{job=~"kubelet"}'
Query the metric label list
# 查询指定指标的所有标签
python /root/.openclaw/workspace/skills/byted-volcengine-vmp/scripts/get_metric_labels.py \
--workspace-id <workspace-id> \
--metric-name up
API Description
Workspace Management
ListWorkspaces
Query the VMP workspace list
Parameter description:
- No special parameters
Returns: VMP workspace list
Metrics Query
QueryMetrics (instant query)
Execute a PromQL instant query
Parameter description:
workspaceId: Workspace IDquery: PromQL query statementtime: Query time (optional, defaults to the current time)
Returns: PromQL query result
QueryMetricsRange (range query)
Execute a PromQL range query
Parameter description:
workspaceId: Workspace IDquery: PromQL query statementstart: Start timeend: End timestep: Query step (optional, calculated automatically)
Returns: PromQL range query result
GetLabelValues
Query label values
Parameter description:
workspaceId: Workspace IDlabel: Label name (such as__name__indicates the metric name)match: Match condition (optional)
Returns: Label value list
GetLabels
Query label names
Parameter description:
workspaceId: Workspace IDmatch: Match condition (optional)
Returns: Tag Name List
Common Regions
Default region:cn-beijing
| Region | Region ID |
|---|---|
| North China 2 (Beijing) | cn-beijing |
| East China 2 (Shanghai) | cn-shanghai |
| South China 1 (Guangzhou) | cn-guangzhou |
| Hong Kong (China) | cn-hongkong |
| Asia Pacific Southeast (Johor) | ap-southeast-1 |
| Asia Pacific Southeast (Jakarta) | ap-southeast-3 |