Queries a specified monitoring configuration of a Prometheus instance.
This API has been deprecated with no replacement. While temporary access is maintained, no further updates or bug fixes will be provided. To ensure continued functionality, plan your migration and contact your account manager for support.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. |
cn-hangzhou |
| ClusterId |
string |
Yes |
The ID of the Prometheus instance. |
cc7a37ee31aea4ed1a059eff8034b**** |
| Type |
string |
Yes |
The type of the monitoring configuration. Valid values for a Prometheus instance for Container Service: serviceMonitor, podMonitor, customJob, and probe. Valid values for a Prometheus instance for ECS: customJob and probe. |
customJob |
| MonitoringName |
string |
Yes |
The name of the monitoring configuration. |
customJob1 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
78901766-3806-4E96-8E47-CFEF59E4**** |
| Code |
integer |
The HTTP status code. A value of 200 indicates a successful request. |
200 |
| Data |
object |
The returned data object. |
|
| ClusterId |
string |
The ID of the Prometheus instance. |
c589a1b8db05c4561aefbb898ca8fb1cf |
| MonitoringName |
string |
The name of the monitoring configuration. |
customJob1 |
| Type |
string |
The type of the monitoring configuration. Valid values: serviceMonitor, podMonitor, customJob, and probe. |
serviceMonitor |
| Status |
string |
The status of the monitoring configuration. Valid values: run and stop. |
run |
| ConfigYaml |
string |
The monitoring configuration in YAML format. |
参见返回参数补充说明。 |
| Message |
string |
The response message. |
message |
ServiceMonitor example:
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: tomcat-demo
namespace: default
spec:
endpoints:
- interval: 30s
path: /metrics
port: tomcat-monitor
namespaceSelector:
any: true
selector:
matchLabels:
app: tomcat
PodMonitor example:
apiVersion: "monitoring.coreos.com/v1"
kind: "PodMonitor"
metadata:
name: "podmonitor-demo"
namespace: "default"
spec:
namespaceSelector:
any: true
podMetricsEndpoints:
- interval: "30s"
path: "/metrics"
port: "tomcat-monitor"
selector:
matchLabels:
app: "nginx2-exporter"
CustomJob example:
scrape_configs:
- job_name: prometheus1
honor_timestamps: false
honor_labels: false
scheme: http
metrics_path: /metric
static_configs:
- targets:
- 127.0.0.1:9090
Probe example:
apiVersion: monitoring.coreos.com/v1
kind: Probe
metadata:
name: name1-tcp-blackbox # Rule: xxx-{tcp/http/ping}-blackbox
namespace: arms-prom # Optional.
spec:
interval: 30s
jobName: blackbox
module: tcp_connect
prober:
path: /blackbox/probe
scheme: http
url: 'localhost:9335'
targets:
staticConfig:
static:
- 'arms-prom-admin.arms-prom:9335'
Examples
Success response
JSON format
{
"RequestId": "78901766-3806-4E96-8E47-CFEF59E4****",
"Code": 200,
"Data": {
"ClusterId": "c589a1b8db05c4561aefbb898ca8fb1cf",
"MonitoringName": "customJob1",
"Type": "serviceMonitor",
"Status": "run",
"ConfigYaml": "参见返回参数补充说明。"
},
"Message": "message"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.