Skip to content

Commit

Permalink
in_prometheus_remote_write: Add documentation for input plugin of pro…
Browse files Browse the repository at this point in the history
…metheus remote write (#1363)

* in_prometheus_remote_write: Add documentation for input plugin of prometheus remote write

Signed-off-by: Hiroshi Hatake <[email protected]>

* Update pipeline/inputs/prometheus-remote-write.md

Co-authored-by: Pat <[email protected]>
Signed-off-by: Hiroshi Hatake <[email protected]>

* Address comments

Signed-off-by: Hiroshi Hatake <[email protected]>

* Use prometheus endpoint like example in a parameter description

Signed-off-by: Hiroshi Hatake <[email protected]>

* in_prometheus_remote_write: Use 8080 as a default port number

Signed-off-by: Hiroshi Hatake <[email protected]>

* in_prometheus_remote_write: Add example TLS enabled configuration

Signed-off-by: Hiroshi Hatake <[email protected]>

* in_prometheus_remote_write: Add more descriptions for prioritized conditions

Signed-off-by: Hiroshi Hatake <[email protected]>

* Update pipeline/inputs/prometheus-remote-write.md

Co-authored-by: Pat <[email protected]>
Signed-off-by: Hiroshi Hatake <[email protected]>

* transport-security: in_prometheus_remite_write: Add mention for transport-security

Signed-off-by: Hiroshi Hatake <[email protected]>

* Apply suggestions

Co-authored-by: Pat <[email protected]>
Signed-off-by: Hiroshi Hatake <[email protected]>

---------

Signed-off-by: Hiroshi Hatake <[email protected]>
Co-authored-by: Pat <[email protected]>
  • Loading branch information
cosmo0920 and patrick-stephens authored May 29, 2024
1 parent 100aed5 commit 5fedd4e
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
* [Process Log Based Metrics](pipeline/inputs/process.md)
* [Process Exporter Metrics](pipeline/inputs/process-exporter-metrics.md)
* [Prometheus Scrape Metrics](pipeline/inputs/prometheus-scrape-metrics.md)
* [Prometheus Remote Write](pipeline/inputs/prometheus-remote-write.md)
* [Random](pipeline/inputs/random.md)
* [Serial Interface](pipeline/inputs/serial-interface.md)
* [Splunk](pipeline/inputs/splunk.md)
Expand Down
1 change: 1 addition & 0 deletions administration/transport-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ The following **input** plugins can take advantage of the TLS feature:
* [NGINX Exporter Metrics](../pipeline/inputs/nginx.md)
* [OpenTelemetry](../pipeline/inputs/opentelemetry.md)
* [Prometheus Scrape Metrics](../pipeline/inputs/prometheus-scrape-metrics.md)
* [Prometheus Remote Write](../pipeline/inputs/prometheus-remote-write.md)
* [Splunk (HTTP HEC)](../pipeline/inputs/splunk.md)
* [Syslog](../pipeline/inputs/syslog.md)
* [TCP](../pipeline/inputs/tcp.md)
Expand Down
77 changes: 77 additions & 0 deletions pipeline/inputs/prometheus-remote-write.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
description: An input plugin to ingest payloads of Prometheus remote write
---

# Prometheus Remote Write

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.

## Configuration

| Key | Description | default |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| listen | The address to listen on | 0.0.0.0 |
| port | The port for Fluent Bit to listen on | 8080 |
| buffer\_max\_size | Specify the maximum buffer size in KB to receive a JSON message. | 4M |
| 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 |
|successful\_response\_code | It allows to set successful response code. `200`, `201` and `204` are supported.| 201 |
| 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 |



A sample config file to get started will look something like the following:


{% tabs %}
{% tab title="fluent-bit.conf" %}
```
[INPUT]
name prometheus_remote_write
listen 127.0.0.1
port 8080
uri /api/prom/push
[OUTPUT]
name stdout
match *
```
{% endtab %}

{% tab title="fluent-bit.yaml" %}
```yaml
pipeline:
inputs:
- name: prometheus_remote_write
listen: 127.0.0.1
port: 8080
uri: /api/prom/push
outputs:
- name: stdout
match: '*'
```
{% endtab %}
{% endtabs %}
With the above configuration, Fluent Bit will listen on port `8080` for data.
You can now send payloads in Prometheus remote write format to the endpoint `/api/prom/push`.

## Examples

### Communicate with TLS

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.

Communicating with TLS, you will need to use the tls related parameters:

```
[INPUT]
Name prometheus_remote_write
Listen 127.0.0.1
Port 8080
Uri /api/prom/push
Tls On
tls.crt_file /path/to/certificate.crt
tls.key_file /path/to/certificate.key
```

Now, you should be able to send data over TLS to the remote write input.

0 comments on commit 5fedd4e

Please sign in to comment.