All Products
Search
Document Center

Managed Service for Prometheus:ListEnvironmentMetricTargets

Last Updated:May 07, 2025

Queries the targets of an environment.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
arms:ListEnvironmentMetricTargetsnone
*Environment
acs:arms:{#regionId}:{#accountId}:environment/{#environmentId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
EnvironmentIdstringYes

The environment ID.

env-xxx
RegionIdstringNo

The region ID.

cn-hangzhou
JobNamestringNo

The job name.

blackbox

Response parameters

ParameterTypeDescriptionExample
object

response

RequestIdstring

The request ID.

16AF921B-8187-489F-9913-43C808B4****
Codeinteger

The status code. The status code 200 indicates that the request was successful.

200
Messagestring

The returned message.

success
Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true
Dataobject

The struct returned.

ActiveTargetsarray<object>

The active targets.

activeTargetsobject

The target information.

DiscoveredLabelsobject

The tags used for service discovery.

string

The tag value.

{ "__meta_kubernetes_pod_label_pod_template_hash": "7477c58b8d", "__meta_kubernetes_endpoints_name": "mysql-exporter-mysql-1694448841945-service", "__meta_kubernetes_endpoint_port_name": "metrics" }
GlobalUrlstring

The URL of the target.

http://xxx
Healthstring

The health status.

up
Labelsobject

The tags.

string

The tag value.

{ "endpoint": "metrics", "instance": "172.16.0.9:9104", "pod": "mysql-1694570927659-7655486df8-djg22", "service": "mysql-exporter-mysql-1694570927659-service", "namespace": "arms-prom", "job": "mysql-exporter-mysql-1694570927659-service" }
LastErrorstring

The last error message.

Get \"http://172.16.0.86:9104/metrics\": dial tcp 172.16.0.86:9104: connect: connection refused
LastScrapestring

The last collection time.

2023-10-12T07:15:47.306691514Z
LastScrapeDurationdouble

The duration of the last collection.

0.00127593
LastScrapeSerieslong

The amount of metrics in the last collection.

122
ScrapePoolstring

The name of the collection.

arms-prom/mysql-exporter-mysql-1694429267986-sm/0"
ScrapeUrlstring

The URL of the collection.

http://xxxx
DroppedTargetsarray<object>

The deleted targets.

droppedTargetsobject

The target information.

DiscoveredLabelsobject

The tags used for service discovery.

string

The tag value.

{ "__meta_kubernetes_pod_label_pod_template_hash": "7477c58b8d", "__meta_kubernetes_endpoints_name": "mysql-exporter-mysql-1694448841945-service", "__meta_kubernetes_endpoint_port_name": "metrics" }
GlobalUrlstring

The URL of the target.

http://xxx
Healthstring

The health status.

up
Labelsobject

The tags.

string

The tag value.

{ "endpoint": "metrics", "instance": "172.16.0.9:9104", "pod": "mysql-1694570927659-7655486df8-djg22", "service": "mysql-exporter-mysql-1694570927659-service", "namespace": "arms-prom", "job": "mysql-exporter-mysql-1694570927659-service" }
LastErrorstring

The last error message.

Get \"http://172.16.0.86:9104/metrics\": dial tcp 172.16.0.86:9104: connect: connection refused
LastScrapestring

The last collection time.

2023-10-12T07:15:47.306691514Z
LastScrapeDurationdouble

The duration of the last collection.

0.00127593
LastScrapeSerieslong

The amount of metrics in the last collection.

122
ScrapePoolstring

The name of the collection.

arms-prom/mysql-exporter-mysql-1694429267986-sm/0"
ScrapeUrlstring

The URL of the collection.

http://xxxx

Examples

Sample success responses

JSONformat

{
  "RequestId": "16AF921B-8187-489F-9913-43C808B4****",
  "Code": 200,
  "Message": "success",
  "Success": true,
  "Data": {
    "ActiveTargets": [
      {
        "DiscoveredLabels": {
          "key": {
            "__meta_kubernetes_pod_label_pod_template_hash": "7477c58b8d",
            "__meta_kubernetes_endpoints_name": "mysql-exporter-mysql-1694448841945-service",
            "__meta_kubernetes_endpoint_port_name": "metrics"
          }
        },
        "GlobalUrl": "http://xxx",
        "Health": "up",
        "Labels": {
          "key": {
            "endpoint": "metrics",
            "instance": "172.16.0.9:9104",
            "pod": "mysql-1694570927659-7655486df8-djg22",
            "service": "mysql-exporter-mysql-1694570927659-service",
            "namespace": "arms-prom",
            "job": "mysql-exporter-mysql-1694570927659-service"
          }
        },
        "LastError": "Get \\\"http://172.16.0.86:9104/metrics\\\": dial tcp 172.16.0.86:9104: connect: connection refused",
        "LastScrape": "2023-10-12T07:15:47.306691514Z",
        "LastScrapeDuration": 0.00127593,
        "LastScrapeSeries": 122,
        "ScrapePool": "arms-prom/mysql-exporter-mysql-1694429267986-sm/0\"",
        "ScrapeUrl": "http://xxxx"
      }
    ],
    "DroppedTargets": [
      {
        "DiscoveredLabels": {
          "key": {
            "__meta_kubernetes_pod_label_pod_template_hash": "7477c58b8d",
            "__meta_kubernetes_endpoints_name": "mysql-exporter-mysql-1694448841945-service",
            "__meta_kubernetes_endpoint_port_name": "metrics"
          }
        },
        "GlobalUrl": "http://xxx",
        "Health": "up",
        "Labels": {
          "key": {
            "endpoint": "metrics",
            "instance": "172.16.0.9:9104",
            "pod": "mysql-1694570927659-7655486df8-djg22",
            "service": "mysql-exporter-mysql-1694570927659-service",
            "namespace": "arms-prom",
            "job": "mysql-exporter-mysql-1694570927659-service"
          }
        },
        "LastError": "Get \\\"http://172.16.0.86:9104/metrics\\\": dial tcp 172.16.0.86:9104: connect: connection refused",
        "LastScrape": "2023-10-12T07:15:47.306691514Z",
        "LastScrapeDuration": 0.00127593,
        "LastScrapeSeries": 122,
        "ScrapePool": "arms-prom/mysql-exporter-mysql-1694429267986-sm/0\"",
        "ScrapeUrl": "http://xxxx"
      }
    ]
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history