Skip to content

Commit e4f6a3e

Browse files
cosmo0920edsiper
authored andcommitted
in_statsd: Add an example for metrics setup
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
1 parent 5475614 commit e4f6a3e

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

pipeline/inputs/statsd.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,53 @@ Fluent Bit will produce the following records:
6969
[0] statsd.0: [1574905088.971380537, {"type"=>"counter", "bucket"=>"click", "value"=>10.000000, "sample_rate"=>0.100000}]
7070
[0] statsd.0: [1574905141.863344517, {"type"=>"gauge", "bucket"=>"active", "value"=>99.000000, "incremental"=>0}]
7171
```
72+
73+
## Metrics Setup
74+
75+
Here is a configuration example for metrics setup.
76+
77+
{% tabs %}
78+
{% tab title="fluent-bit.conf" %}
79+
```python
80+
[INPUT]
81+
Name statsd
82+
Listen 0.0.0.0
83+
Port 8125
84+
Metrics On
85+
86+
[OUTPUT]
87+
Name stdout
88+
Match *
89+
```
90+
{% endtab %}
91+
92+
{% tab title="fluent-bit.yaml" %}
93+
```yaml
94+
pipeline:
95+
inputs:
96+
- name: statsd
97+
listen: 0.0.0.0
98+
port: 8125
99+
metrics: On
100+
outputs:
101+
- name: stdout
102+
match: '*'
103+
```
104+
{% endtab %}
105+
{% endtabs %}
106+
107+
Now you can input metrics as metrics type of events through the UDP port as follows:
108+
109+
```bash
110+
echo "click:+10|c|@0.01|#hello:tag" | nc -q0 -u 127.0.0.1 8125
111+
echo "active:+99|g|@0.01" | nc -q0 -u 127.0.0.1 8125
112+
echo "inactive:29|g|@0.0125|#hi:from_fluent-bit" | nc -q0 -u 127.0.0.1 8125
113+
```
114+
115+
Fluent Bit will procude the following metrics events:
116+
117+
```
118+
2025-01-09T11:40:26.562424694Z click{incremental="true",hello="tag"} = 1000
119+
2025-01-09T11:40:28.591477424Z active{incremental="true"} = 9900
120+
2025-01-09T11:40:31.593118033Z inactive{hi="from_fluent-bit"} = 2320
121+
```

0 commit comments

Comments
 (0)