

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# RemoteWrite
<a name="AMP-APIReference-RemoteWrite"></a>

`RemoteWrite` 操作以标准格式将指标从 Prometheus 服务器写入远程 URL。通常，您将使用现有客户端（例如 Prometheus 服务器）来调用此操作。

有效的 HTTP 动词：  
`POST`

有效 URIs：  
`/workspaces/workspaceId/api/v1/remote_write`

URL 查询参数：  
无

`RemoteWrite` 摄取率为每秒 7 万个样本，摄入突增大小为 100 万个样本。

**示例请求**

```
POST /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/api/v1/remote_write --data-binary "@real-dataset.sz" HTTP/1.1
Authorization: AUTHPARAMS
X-Amz-Date: 20201201T193725Z
User-Agent: Prometheus/2.20.1
Content-Type: application/x-protobuf
Content-Encoding: snappy
X-Prometheus-Remote-Write-Version: 0.1.0

body
```

**注意**  
有关请求正文语法，请参阅 [ https://github.com/prometheus/prometheus/blob/1c624c58ca934f618be737b4995e22051f5724c1/prompb/remote.pb.go](https://github.com/prometheus/prometheus/blob/1c624c58ca934f618be737b4995e22051f5724c1/prompb/remote.pb.go#L64) \$1L64 上的协议缓冲区定义。

**示例响应**

```
HTTP/1.1 200 OK
x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535
Content-Length:0
Connection: keep-alive
Date: Tue, 01 Dec 2020 19:37:25 GMT
Content-Type: application/json
Server: amazon
vary: Origin
```