Skip to content

Commit 39b2748

Browse files
authored
out_prometheus_exporter: add examples for yaml configuration (#1307)
Signed-off-by: Takahiro Yamashita <[email protected]>
1 parent 57a271d commit 39b2748

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

pipeline/outputs/prometheus-exporter.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Important Note: The prometheus exporter only works with metric plugins, such as
1818

1919
The Prometheus exporter only works with metrics captured from metric plugins. In the following example, host metrics are captured by the node exporter metrics plugin and then are routed to prometheus exporter. Within the output plugin two labels are added `app="fluent-bit"`and `color="blue"`
2020

21+
{% tabs %}
22+
{% tab title="fluent-bit.conf" %}
2123
```text
2224
# Node Exporter Metrics + Prometheus Exporter
2325
# -------------------------------------------
@@ -46,4 +48,36 @@ The Prometheus exporter only works with metrics captured from metric plugins. In
4648
add_label app fluent-bit
4749
add_label color blue
4850
```
51+
{% endtab %}
4952

53+
{% tab title="fluent-bit.yaml" %}
54+
```yaml
55+
# Node Exporter Metrics + Prometheus Exporter
56+
# -------------------------------------------
57+
# The following example collect host metrics on Linux and expose
58+
# them through a Prometheus HTTP end-point.
59+
#
60+
# After starting the service try it with:
61+
#
62+
# $ curl http://127.0.0.1:2021/metrics
63+
#
64+
service:
65+
flush: 1
66+
log_level: info
67+
pipeline:
68+
inputs:
69+
- name: node_exporter_metrics
70+
tag: node_metrics
71+
scrape_interval: 2
72+
outputs:
73+
- name: prometheus_exporter
74+
match: node_metrics
75+
host: 0.0.0.0
76+
port: 2021
77+
# add user-defined labels
78+
add_label:
79+
- app fluent-bit
80+
- color blue
81+
```
82+
{% endtab %}
83+
{% endtabs %}

0 commit comments

Comments
 (0)