Skip to content

Commit 740a064

Browse files
cosmo0920Pat
and
Pat
authored
processor_metrics_selector: Add documents for metrics_selector processor (fluent#1340)
* processor_metrics_selector: Add documents for metrics_selector processor Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io> * Update installation/sources/build-and-install.md Co-authored-by: Pat <pat@calyptia.com> Signed-off-by: Hiroshi Hatake <hatake@calyptia.com> * Update pipeline/processors/metrics-selector.md Co-authored-by: Pat <pat@calyptia.com> Signed-off-by: Hiroshi Hatake <hatake@calyptia.com> * Update pipeline/processors/metrics-selector.md Co-authored-by: Pat <pat@calyptia.com> Signed-off-by: Hiroshi Hatake <hatake@calyptia.com> * processor_metrics_selector: Add a example description for a making regular expression Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io> --------- Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io> Signed-off-by: Hiroshi Hatake <hatake@calyptia.com> Co-authored-by: Pat <pat@calyptia.com>
1 parent 9be485b commit 740a064

File tree

5 files changed

+76
-0
lines changed

5 files changed

+76
-0
lines changed

.gitbook.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,6 @@ redirects:
7676
output/stdout: ./pipeline/outputs/standard-output.md
7777
output/tcp: ./pipeline/outputs/tcp-and-tls.md
7878
output/td: ./pipeline/outputs/treasure-data.md
79+
80+
# Processors
81+
processor/metrics_selector: ./pipeline/processors/metrics_selector.md

SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@
194194
* [Treasure Data](pipeline/outputs/treasure-data.md)
195195
* [Vivo Exporter](pipeline/outputs/vivo-exporter.md)
196196
* [WebSocket](pipeline/outputs/websocket.md)
197+
* [Processors](pipeline/processors/README.md)
198+
* [Metrics Selector](pipeline/processors/metrics-selector.md)
197199

198200
## Stream Processing
199201

installation/sources/build-and-install.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,11 @@ The _output plugins_ gives the capacity to flush the information to some externa
212212
| FLB\_OUT\_TCP | Enable TCP/TLS output plugin | On |
213213
| [FLB\_OUT\_TD](../../pipeline/outputs/treasure-data.md) | Enable [Treasure Data](http://www.treasuredata.com) output plugin | On |
214214

215+
### Processor Plugins
216+
217+
The _processor plugins_ provide the capability to handle the events within the processor pipelines to allow modifying, enrich or drop events.
218+
The following table describes the processors available on this version:
219+
220+
| option | description | default |
221+
| :--- | :--- | :--- |
222+
| [FLB\_PROCESSOR\_METRICS\_SELECTOR](../../pipeline/processors/metrics-selector.md) | Enable metrics selector processor | On |

pipeline/processors/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Processors
2+
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Metrics Selector
2+
3+
The **metric_selector** processor allows you to select metrics to include or exclude (similar to the `grep` filter for logs).
4+
5+
## Configuration Parameters <a id="config"></a>
6+
7+
The native processor plugin supports the following configuration parameters:
8+
9+
| Key | Description | Default |
10+
| :---------- | :--- | :--- |
11+
| Metric\_Name | Keep metrics in which the metric of name matches with the actual name or the regular expression. | |
12+
| Context | Specify matching context. Currently, metric_name is only supported. | `Metrics_Name` |
13+
| Action | Specify the action for specified metrics. INCLUDE and EXCLUDE are allowed. | |
14+
| Operation\_Type | Specify the operation type of action for metrics payloads. PREFIX and SUBSTRING are allowed. | |
15+
16+
## Configuration Examples <a id="config_example"></a>
17+
18+
Here is a basic configuration example.
19+
20+
{% tabs %}
21+
{% tab title="fluent-bit.yaml" %}
22+
```yaml
23+
service:
24+
flush: 5
25+
daemon: off
26+
log_level: info
27+
28+
pipeline:
29+
inputs:
30+
- name: fluentbit_metrics
31+
tag: fluentbit.metrics
32+
scrape_interval: 10
33+
34+
processors:
35+
metrics:
36+
- name: metrics_selector
37+
metric_name: /storage/
38+
action: include
39+
- name: metrics_selector
40+
metric_name: /fs/
41+
action: exclude
42+
43+
- name: labels
44+
delete: name
45+
46+
47+
outputs:
48+
- name: stdout
49+
match: '*'
50+
```
51+
{% endtab %}
52+
{% endtabs %}
53+
54+
55+
All processors are only valid with the YAML configuration format.
56+
Processor configuration should be located under the relevant input or output plugin configuration.
57+
58+
Metric\_Name parameter will translate the strings which is quoted with backslashes `/.../` as Regular expressions.
59+
Without them, users need to specify Operation\_Type whether prefix matching or substring matching.
60+
The default operation is prefix matching.
61+
For example, `/chunks/` will be translated as a regular expression.

0 commit comments

Comments
 (0)