|
| 1 | +--- |
| 2 | +description: An input plugin to ingest payloads of Prometheus remote write |
| 3 | +--- |
| 4 | + |
| 5 | +# Prometheus Remote Write |
| 6 | + |
| 7 | +This input plugin allows you to ingest a payload in the Prometheus remote-write format, i.e. a remote write sender can transmit data to Fluent Bit. |
| 8 | + |
| 9 | +## Configuration |
| 10 | + |
| 11 | +| Key | Description | default | |
| 12 | +| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------- | |
| 13 | +| listen | The address to listen on | 0.0.0.0 | |
| 14 | +| port | The port for Fluent Bit to listen on | 8080 | |
| 15 | +| buffer\_max\_size | Specify the maximum buffer size in KB to receive a JSON message. | 4M | |
| 16 | +| buffer\_chunk\_size | This sets the chunk size for incoming incoming JSON messages. These chunks are then stored/managed in the space available by buffer_max_size. | 512K | |
| 17 | +|successful\_response\_code | It allows to set successful response code. `200`, `201` and `204` are supported.| 201 | |
| 18 | +| tag\_from\_uri | If true, tag will be created from uri, e.g. api\_prom\_push from /api/prom/push, and any tag specified in the config will be ignored. If false then a tag must be provided in the config for this input. | true | |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +A sample config file to get started will look something like the following: |
| 23 | + |
| 24 | + |
| 25 | +{% tabs %} |
| 26 | +{% tab title="fluent-bit.conf" %} |
| 27 | +``` |
| 28 | +[INPUT] |
| 29 | + name prometheus_remote_write |
| 30 | + listen 127.0.0.1 |
| 31 | + port 8080 |
| 32 | + uri /api/prom/push |
| 33 | +
|
| 34 | +[OUTPUT] |
| 35 | + name stdout |
| 36 | + match * |
| 37 | +``` |
| 38 | +{% endtab %} |
| 39 | + |
| 40 | +{% tab title="fluent-bit.yaml" %} |
| 41 | +```yaml |
| 42 | +pipeline: |
| 43 | + inputs: |
| 44 | + - name: prometheus_remote_write |
| 45 | + listen: 127.0.0.1 |
| 46 | + port: 8080 |
| 47 | + uri: /api/prom/push |
| 48 | + outputs: |
| 49 | + - name: stdout |
| 50 | + match: '*' |
| 51 | +``` |
| 52 | +{% endtab %} |
| 53 | +{% endtabs %} |
| 54 | +
|
| 55 | +With the above configuration, Fluent Bit will listen on port `8080` for data. |
| 56 | +You can now send payloads in Prometheus remote write format to the endpoint `/api/prom/push`. |
| 57 | + |
| 58 | +## Examples |
| 59 | + |
| 60 | +### Communicate with TLS |
| 61 | + |
| 62 | +Prometheus Remote Write input plugin supports TLS/SSL, for more details about the properties available and general configuration, please refer to the [TLS/SSL](../../administration/transport-security.md) section. |
| 63 | + |
| 64 | +Communicating with TLS, you will need to use the tls related parameters: |
| 65 | + |
| 66 | +``` |
| 67 | +[INPUT] |
| 68 | + Name prometheus_remote_write |
| 69 | + Listen 127.0.0.1 |
| 70 | + Port 8080 |
| 71 | + Uri /api/prom/push |
| 72 | + Tls On |
| 73 | + tls.crt_file /path/to/certificate.crt |
| 74 | + tls.key_file /path/to/certificate.key |
| 75 | +``` |
| 76 | + |
| 77 | +Now, you should be able to send data over TLS to the remote write input. |
0 commit comments