Prometheus Remote Write
Accepts Prometheus remote-write data directly to your pipeline's ingest 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 your pipeline's ingest host, https://<pipeline-id>.data.monad.com, where <pipeline-id> is the ID of the pipeline you've configured the input in. The hostname names the pipeline, so the URL needs no path.
To setup remote-write, you must edit your prometheus.yml file to add a remote-write section. It should look like the below
Code
Self-hosted deployments
A per-pipeline ingest host needs the *.data.<your Monad domain> wildcard in place: a DNS record plus a matching certificate SAN. Monad Cloud has this. A self-hosted deployment has it only if whoever installed Monad set it up, so check with them if you are not sure. See Customer Helm Install for the setup.
Without it, send exactly the same request to your own Monad hostname, with the pipeline ID in the path:
https://<your-monad-host>/api/v2/http/send/<pipeline-id>
Authentication, request body, and responses are the same either way.
Response Examples
Success Response (200)
The API returns JSON responses and standard response codes.
JSON will respond with an HTTP 200 with body
Code
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 |
Sync frequency
This is a push (receiver) input: Monad ingests records as the source sends them, so there is no polling interval. See Input Sync Frequency for details.