Prometheus Remote Write
Accepts Prometheus remote-write data directly to the Monad API endpoint.
Requirements
There are no prerequisites to start using the Prometheus Remote Write input. Simply create the input and attach it to a pipeline.
Authentication
All requests to the Remote Write input endpoint require authentication using an organization API key with the pipeline:data:write permission.
API Key Requirements
The API key must meet the following requirements:
- Must be an organization API key (not a personal API key)
- Must have the
pipeline:data:writepermission, which is included by default in the following roles:- Contributor
- System Administrator
- Alternatively, the permission can be added to a custom role
Required Headers
You must include the following authentication header:
- x-api-key:
<your-api-key>
How to do so is detailed below.
Sending data
Prometheus must be configured to write data to our API endpoint at /api/v2/http/send/<your-pipeline-id>, where <your-pipeline-id> is the ID of the pipeline you've configured the input in.
To setup remote-write, you must edit your prometheus.yml file to add a remote-write section. It should look like the below
remote_write:
- url: https://app.monad.com/api/v2/http/send/<your-pipeline-id>
headers:
x-api-key: "<your-api-key>"
Response Examples
Success Response (200)
The API returns JSON responses and standard response codes.
JSON will respond with an HTTP 200 with body
{
"code": 0,
"message": "OK"
}
In error cases, proper error HTTP response statuses and an error hint will be returned, that Prometheus will log.
Error Responses
Below are some common errors. Others may occur depending on differing error conditions.
| Response | Description |
|---|---|
authorization required | No authentication header was provided |
invalid JWT | The provided JWT token is invalid |
failed to get api key | The API key is no longer valid |
access denied: this endpoint requires pipeline:data:write | The API key lacks the required pipeline:data:write permission |
An item of this type does not exist. | The provided pipeline ID does not exist |
pipeline not found or not an HTTP input | The pipeline exists but is not configured as an HTTP input |