From 99b143d074b62ef44944f904ce489bc690ebf132 Mon Sep 17 00:00:00 2001 From: Lynette Miles Date: Tue, 1 Jul 2025 13:07:00 -0700 Subject: [PATCH 1/2] Pipeline: input: statsd: style Signed-off-by: Lynette Miles --- pipeline/inputs/statsd.md | 95 ++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 45 deletions(-) diff --git a/pipeline/inputs/statsd.md b/pipeline/inputs/statsd.md index 3bf30bb92..960c607af 100644 --- a/pipeline/inputs/statsd.md +++ b/pipeline/inputs/statsd.md @@ -1,35 +1,48 @@ # StatsD -The **statsd** input plugin allows you to receive metrics via StatsD protocol. +The _StatsD_ input plugin lets you receive metrics using StatsD protocol. -Content: - -* [Configuration Parameters](statsd.md#config) -* [Configuration Examples](statsd.md#config_example) - -## Configuration Parameters +## Configuration parameters The plugin supports the following configuration parameters: | Key | Description | Default | | :--- | :--- | :--- | -| Listen | Listener network interface. | 0.0.0.0 | -| Port | UDP port where listening for connections | 8125 | -| Threaded | Indicates whether to run this input in its own [thread](../../administration/multithreading.md#inputs). | `false` | -| Metrics | Ingested record will be marked as a metric record rather than a log record. | `off` | - -Note: When enabling `Metrics On`, we will also handle metrics from the DogStatsD protocol and the internal record in Fluent Bit will be handled as a metric type for downstream processing. -[The full format of DogStatsD of metrics](https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/?tab=metrics#the-dogstatsd-protocol) is not supported. -Including key-value format of tags as below is supported: +| `Listen` | Listener network interface. | `0.0.0.0` | +| `Port` | UDP port that listens for connections. | `8125` | +| `Threaded` | Indicates whether to run this input in its own [thread](../../administration/multithreading.md#inputs). | `false` | +| `Metrics` | Ingested record will be marked as a metric record rather than a log record. | `off` | + +When enabling `Metrics On`, Fluent Bit will also handle metrics from the DogStatsD protocol. The internal record in Fluent Bit will be handled as a metric type for downstream processing. + +[The full format of DogStatsD of metrics](https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/?tab=metrics#the-dogstatsd-protocol) isn't supported. + +Including key-value format of tags is supported: `:||@|#:` -[Events](https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/?tab=events#the-dogstatsd-protocol) and [ServiceChecks](https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/?tab=servicechecks#the-dogstatsd-protocol) formats are not supported yet with `Metrics On`. -## Configuration Examples +[Events](https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/?tab=events#the-dogstatsd-protocol) and [ServiceChecks](https://docs.datadoghq.com/developers/dogstatsd/datagram_shell/?tab=servicechecks#the-dogstatsd-protocol) formats aren't supported with `Metrics On`. + +## Configuration example Here is a configuration example. {% tabs %} +{% tab title="fluent-bit.yaml" %} + +```yaml +pipeline: + inputs: + - name: statsd + listen: 0.0.0.0 + port: 8125 + outputs: + - name: stdout + match: '*' +``` + +{% endtab %} {% tab title="fluent-bit.conf" %} + ```python [INPUT] Name statsd @@ -40,19 +53,7 @@ Here is a configuration example. Name stdout Match * ``` -{% endtab %} -{% tab title="fluent-bit.yaml" %} -```yaml -pipeline: - inputs: - - name: statsd - listen: 0.0.0.0 - port: 8125 - outputs: - - name: stdout - match: '*' -``` {% endtab %} {% endtabs %} @@ -70,26 +71,14 @@ Fluent Bit will produce the following records: [0] statsd.0: [1574905141.863344517, {"type"=>"gauge", "bucket"=>"active", "value"=>99.000000, "incremental"=>0}] ``` -## Metrics Setup +## Metrics setup Here is a configuration example for metrics setup. {% tabs %} -{% tab title="fluent-bit.conf" %} -```python -[INPUT] - Name statsd - Listen 0.0.0.0 - Port 8125 - Metrics On - -[OUTPUT] - Name stdout - Match * -``` -{% endtab %} {% tab title="fluent-bit.yaml" %} + ```yaml pipeline: inputs: @@ -101,6 +90,22 @@ pipeline: - name: stdout match: '*' ``` + +{% endtab %} +{% tab title="fluent-bit.conf" %} + +```python +[INPUT] + Name statsd + Listen 0.0.0.0 + Port 8125 + Metrics On + +[OUTPUT] + Name stdout + Match * +``` + {% endtab %} {% endtabs %} @@ -112,9 +117,9 @@ echo "active:+99|g|@0.01" | nc -q0 -u 127.0.0.1 8125 echo "inactive:29|g|@0.0125|#hi:from_fluent-bit" | nc -q0 -u 127.0.0.1 8125 ``` -Fluent Bit will procude the following metrics events: +Fluent Bit will produce the following metrics events: -``` +```text 2025-01-09T11:40:26.562424694Z click{incremental="true",hello="tag"} = 1000 2025-01-09T11:40:28.591477424Z active{incremental="true"} = 9900 2025-01-09T11:40:31.593118033Z inactive{hi="from_fluent-bit"} = 2320 From a5289d73a4c9a04006d9d26d6e6d076921a92883 Mon Sep 17 00:00:00 2001 From: Lynette Miles <6818907+esmerel@users.noreply.github.com> Date: Tue, 1 Jul 2025 13:42:01 -0700 Subject: [PATCH 2/2] Update pipeline/inputs/statsd.md Co-authored-by: Craig Norris <112565517+cnorris-cs@users.noreply.github.com> Signed-off-by: Lynette Miles <6818907+esmerel@users.noreply.github.com> --- pipeline/inputs/statsd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipeline/inputs/statsd.md b/pipeline/inputs/statsd.md index 960c607af..2f3d28926 100644 --- a/pipeline/inputs/statsd.md +++ b/pipeline/inputs/statsd.md @@ -1,6 +1,6 @@ # StatsD -The _StatsD_ input plugin lets you receive metrics using StatsD protocol. +The _StatsD_ input plugin lets you receive metrics using the StatsD protocol. ## Configuration parameters