Create a data delivery task to deliver metric data from a data source to a storage destination or message queue. This task supports three delivery types: Prometheus Remote Write, Kafka, and MaxCompute. You can also use tags to filter which metrics are delivered and attach custom tags to them.
Try it now
Test
RAM authorization
Request syntax
POST /delivery-tasks HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
|
| taskName |
string |
Yes |
The name of the task. The name can contain Chinese characters, English letters, underscores (_), and hyphens (-). |
my-task |
| dataSourceId |
string |
Yes |
The ID of the Prometheus instance that serves as the data source. |
rw-xxxxxx |
| taskDescription |
string |
No |
The task description. |
my delivery task |
| labelFiltersType |
string |
No |
The mode for applying the label filters. |
Allow |
| labelFilters |
object |
No |
The label conditions for filtering metrics. The key is the label name and the value is the value to match. The filtering behavior is controlled by |
|
|
string |
No |
A key-value pair that specifies a filter condition. For example, |
__name__: up |
|
| externalLabels |
object |
No |
A map of key-value pairs to attach as additional labels to all delivered metrics. |
|
|
string |
No |
A key-value pair for an external label. For example, |
region: cn-hangzhou |
|
| sinkList |
array<object> |
Yes |
An array of delivery destination objects. |
|
|
array<object> |
Yes |
An object that contains the configuration for a delivery destination. |
||
| sinkType |
string |
Yes |
The type of the delivery destination (sink). |
Prometheus |
| sinkConfigs |
object |
No |
The configuration for the sink, specified as key-value pairs. The valid keys and values depend on the value of |
|
|
string |
No |
A configuration setting for the sink. The available settings depend on the |
Url: http://xxxx/api/v1/write |
|
| resourceGroupId |
string |
No |
The ID of the resource group. |
rg-ae******ey |
| tags |
array<object> |
No |
An array of resource tags. |
|
|
object |
No |
A resource tag, specified as a key-value pair. |
||
| key |
string |
No |
The key of the resource tag. |
_cms_workspace |
| value |
string |
No |
The value of the resource tag. |
test |
SinkConfigs parameters
sinkType = Prometheus
| Key | Required | Description | Example value | Enumerated values |
| Url | Yes | Remote Write endpoint. | http://xxxx/api/v1/write | |
| Network | No | Network type. | PublicNetwork | - PublicNetwork (public network) - PrivateNetwork (private network/VPC) |
| VpcId | No | VPC ID. Required if Network is PrivateNetwork. | vpc-xxxxxx | |
| VSwitchId | No | VSwitch ID. | vsw-xxxxxx | |
| SecurityGroupId | No | Security group ID. | sg-xxxxxx | |
| Header | No | Custom HTTP headers, specified as a JSON-formatted map string. | {"aaa":"bbb","ccc":"ddd"} | |
| AuthType | No | Authentication type. | BasicAuth | - BasicAuth - None |
| Username | No | Username for basic authentication. Required if AuthType is BasicAuth. | admin | |
| Password | No | Password for basic authentication. Required if AuthType is BasicAuth. | xxxxxx |
sinkType = AcsKafka
| Key | Required | Description | Example value |
| InstanceId | Yes | Kafka instance ID. | alikafka_xxxxx |
| Topic | Yes | Kafka topic name. | my-topic |
sinkType = AcsMaxCompute
| Key | Required | Description | Example value |
| ServiceName | Yes | MaxCompute service name. | my-mc-service |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The data returned in the response. |
||
| requestId |
string |
The unique ID for the request. |
4CB23A2E-B426-5D4B-9AA2-6C7A508D954B |
| taskId |
string |
The ID of the delivery task. |
98e367d8fb8cc83b |
Examples
Success response
JSON format
{
"requestId": "4CB23A2E-B426-5D4B-9AA2-6C7A508D954B",
"taskId": "98e367d8fb8cc83b"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.