Skip to content

Commit 1594f98

Browse files
authored
Merge pull request #2013 from fluent/lynettemiles/sc-143160/final-vale-cleanup-for-development
2 parents aa4f613 + ee5fb74 commit 1594f98

File tree

6 files changed

+62
-50
lines changed

6 files changed

+62
-50
lines changed

development/developer-guide.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ For cryptographic support, Fluent Bit uses the system installed version of OpenS
1414

1515
When you write Fluent Bit code, you'll use the Fluent Bit versions of the standard C functions for working with memory:
1616

17-
* [`flb_malloc()`](https://github.com/fluent/fluent-bit/blob/master/include/fluent-bit/flb_mem.h): Equivalent to `malloc`, allocates memory.
18-
* [`flb_calloc()`](https://github.com/fluent/fluent-bit/blob/master/include/fluent-bit/flb_mem.h): Equivalent to `calloc`, allocates memory and initializes it to zero.
19-
* [`flb_realloc()`](https://github.com/fluent/fluent-bit/blob/master/include/fluent-bit/flb_mem.h): Equivalent to `realloc`.
20-
* [`flb_free()`](https://github.com/fluent/fluent-bit/blob/master/include/fluent-bit/flb_mem.h): Equivalent to `free`, releases allocated memory.
17+
- [`flb_malloc()`](https://github.com/fluent/fluent-bit/blob/master/include/fluent-bit/flb_mem.h): Equivalent to `malloc`, allocates memory.
18+
- [`flb_calloc()`](https://github.com/fluent/fluent-bit/blob/master/include/fluent-bit/flb_mem.h): Equivalent to `calloc`, allocates memory and initializes it to zero.
19+
- [`flb_realloc()`](https://github.com/fluent/fluent-bit/blob/master/include/fluent-bit/flb_mem.h): Equivalent to `realloc`.
20+
- [`flb_free()`](https://github.com/fluent/fluent-bit/blob/master/include/fluent-bit/flb_mem.h): Equivalent to `free`, releases allocated memory.
2121

2222
{% hint style="info" %}
2323
Many types have specialized create and destroy functions, like [`flb_sds_create()` and `flb_sds_destroy()`](https://github.com/fluent/fluent-bit/blob/master/include/fluent-bit/flb_sds.h).
@@ -33,9 +33,9 @@ In general, you should use SDS strings in any string processing code. SDS string
3333

3434
Fluent Bit has its own network connection library. The key types and functions are defined in the following header files:
3535

36-
* [`flb_upstream.h`](https://github.com/fluent/fluent-bit/blob/master/include/fluent-bit/flb_upstream.h)
37-
* [`flb_http_client.h`](https://github.com/fluent/fluent-bit/blob/master/include/fluent-bit/flb_http_client.h)
38-
* [`flb_io.h`](https://github.com/fluent/fluent-bit/blob/master/include/fluent-bit/flb_io.h)
36+
- [`flb_upstream.h`](https://github.com/fluent/fluent-bit/blob/master/include/fluent-bit/flb_upstream.h)
37+
- [`flb_http_client.h`](https://github.com/fluent/fluent-bit/blob/master/include/fluent-bit/flb_http_client.h)
38+
- [`flb_io.h`](https://github.com/fluent/fluent-bit/blob/master/include/fluent-bit/flb_io.h)
3939

4040
The following code demonstrates an HTTP request in Fluent Bit:
4141

@@ -318,7 +318,8 @@ The [stdout plugin](https://github.com/fluent/fluent-bit/tree/master/plugins/out
318318
Fluent Bit provides a standalone environment for development. Developers who use different operating systems or distributions can develop on a basic, common stack. The development environment provides the required libraries and tools for you.
319319

320320
Development environments are provided for:
321-
- [Devcontainer](https://github.com/fluent/fluent-bit/blob/master/DEVELOPER_GUIDE.md#devcontainer)
321+
322+
- [Development container](https://github.com/fluent/fluent-bit/blob/master/DEVELOPER_GUIDE.md#devcontainer)
322323
- [Vagrant](https://github.com/fluent/fluent-bit/blob/master/DEVELOPER_GUIDE.md#vagrant).
323324

324325
## Testing

development/library_api.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ Fluent Bit is written in C and can be used from any C or C++ application.
66

77
Fluent Bit runs as a service, which means that the exposed API provides interfaces to create and manage contexts, specify inputs and outputs, set configuration parameters, and set routing paths for events or records. A typical usage of this library involves:
88

9-
* Creating library instance and contexts and setting their properties.
10-
* Enabling input plugins and setting their properties.
11-
* Enabling output plugins and setting their properties.
12-
* Starting the library runtime.
13-
* Optionally ingesting records manually.
14-
* Stopping the library runtime.
15-
* Destroying library instances and contexts.
9+
- Creating library instance and contexts and setting their properties.
10+
- Enabling input plugins and setting their properties.
11+
- Enabling output plugins and setting their properties.
12+
- Starting the library runtime.
13+
- Optionally ingesting records manually.
14+
- Stopping the library runtime.
15+
- Destroying library instances and contexts.
1616

1717
## Data types
1818

development/msgpack-format.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1-
# Msgpack format
1+
# MessagePack format
22

3-
Fluent Bit **always** handles every Event message as a structured message using a binary serialization data format called [MessagePack](https://msgpack.org/).
3+
Fluent Bit always handles every Event message as a structured message using a binary serialization data format called [MessagePack](https://msgpack.org/).
44

55
## Fluent Bit usage
66

77
MessagePack is a standard and well-defined format, refer to the official documentation for full details.
88
This section provides an overview of the specific types used by Fluent Bit within the format to help anyone consuming it.
99

10-
* The data structure used by Fluent Bit is a 2-length [`fixarray`](https://github.com/msgpack/msgpack/blob/master/spec.md#array-format-family) of the timestamp and the data.
11-
* The timestamp comes from [`flb_time_append_to_msgpack`])(https://github.com/fluent/fluent-bit/blob/2138cee8f4878733956d42d82f6dcf95f0aa9339/src/flb_time.c#L197), so it's either a `uint64`, a `float64`, or a [`fixext`](https://github.com/msgpack/msgpack/blob/master/spec.md#ext-format-family) where the 4 MSBs are the seconds (big-endian `uint32`) and 4 LSBs are nanoseconds.
12-
* The data itself is just a [`msgpack` map](https://github.com/msgpack/msgpack/blob/master/spec.md#map-format-family) with the keys as strings.
10+
- The data structure used by Fluent Bit is a 2-length [`fixarray`](https://github.com/msgpack/msgpack/blob/master/spec.md#array-format-family) of the timestamp and the data.
11+
- The timestamp comes from [`flb_time_append_to_msgpack`](https://github.com/fluent/fluent-bit/blob/2138cee8f4878733956d42d82f6dcf95f0aa9339/src/flb_time.c#L197), so it's either a `uint64`, a `float64`, or a [`fixext`](https://github.com/msgpack/msgpack/blob/master/spec.md#ext-format-family) where the 4 MSBs are the seconds (big-endian `uint32`) and 4 LSBs are nanoseconds.
12+
- The data itself is a [`msgpack` map](https://github.com/msgpack/msgpack/blob/master/spec.md#map-format-family) with the keys as strings.
1313

1414
## Example
1515

1616
Set up Fluent Bit to send in `msgpack` format to a specific port.
1717

1818
```bash
1919
docker run --rm -it --network=host fluent/fluent-bit /fluent-bit/bin/fluent-bit -i cpu -o tcp://127.0.0.1:5170 -p format=msgpack -v
20-
2120
```
2221

23-
We could send this to stdout but as it is a serialized format you would end up with strange output.
24-
As an example we use the [Python msgpack library](https://msgpack.org/#languages) to deal with it:
22+
You could send this to stdout but as it's a serialized format you would end up with strange output.
23+
As an example, use the [Python `msgpack` library](https://msgpack.org/#languages) to handle it:
2524

2625
```python
2726
#Python3

development/wasm-filter-plugins.md

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ There are no additional requirements to execute Wasm plugins.
1212

1313
#### Build `flb-wamrc` (optional)
1414

15-
`flb-wamrc` is a `flb`-prefixed AOT (ahead of time) compiler that's provided from [`wasm-micro-runtime`](https://github.com/bytecodealliance/wasm-micro-runtime).
15+
`flb-wamrc` is a `flb`-prefixed Ahead of Time (AOT) compiler that's provided from [`wasm-micro-runtime`](https://github.com/bytecodealliance/wasm-micro-runtime).
1616

1717
For `flb-wamrc` support, you must install the LLVM infrastructure and some additional libraries (`libmlir`, `libPolly`, `libedit`, and `libpfm`). For example:
1818

@@ -22,13 +22,13 @@ For `flb-wamrc` support, you must install the LLVM infrastructure and some addit
2222

2323
### For Wasm programs
2424

25-
Currently, Fluent Bit supports the following Wasm tool chains:
25+
Fluent Bit supports the following Wasm tool chains:
2626

27-
* Rust on `wasm32-unknown-unknown`
28-
* rustc 1.62.1 (e092d0b6b 2022-07-16) or later
29-
* [TinyGo](https://github.com/tinygo-org/tinygo) on `wasm32-wasi`
30-
* v0.24.0 or later
31-
* [WASI SDK](https://github.com/WebAssembly/wasi-sdk) 13 or later.
27+
- Rust on `wasm32-unknown-unknown`
28+
- rustc 1.62.1 (`e092d0b6b` 2022-07-16) or later
29+
- [TinyGo](https://github.com/tinygo-org/tinygo) on `wasm32-wasi`
30+
- v0.24.0 or later
31+
- [WASI SDK](https://github.com/WebAssembly/wasi-sdk) 13 or later.
3232

3333
## Get started
3434

@@ -44,8 +44,13 @@ To support AOT-compiled Wasm execution as filter plugins, build Fluent Bit with
4444

4545
Once compiled, you can see new plugins that handle `wasm`, for example:
4646

47+
```shell
48+
bin/fluent-bit -h
49+
```
50+
51+
Which returns results similar to:
52+
4753
```text
48-
$ bin/fluent-bit -h
4954
Usage: fluent-bit [OPTION]
5055
Inputs
5156
# ... other input plugin stuffs
@@ -60,9 +65,9 @@ Filters
6065

6166
The Fluent Bit Wasm filter assumes C ABI, also known as `wasm32-unknown-unknown` on Rust target and `wasm32-wasi` on TinyGo target.
6267

63-
### To Install Additional Components
68+
### Install additional components
6469

65-
TinyGo and WASI SDK support Wasm target by default. When using Rust's `wasm32-unknown-unknown` target, you must install `wasm32-unknown-unknown` by using [rustup](https://rustup.rs/). Then, install the target components as follows:
70+
TinyGo and WASI SDK support Wasm target by default. When using Rust's `wasm32-unknown-unknown` target, you must install `wasm32-unknown-unknown` by using [`rustup`](https://rustup.rs/). Then, install the target components as follows:
6671

6772
```text
6873
rustup target add wasm32-unknown-unknown
@@ -116,7 +121,7 @@ pipeline:
116121
function_name: super_awesome_filter
117122
# Note: run Fluent Bit from the 'wasm_path' location.
118123
accessible_paths: /path/to/fluent-bit
119-
124+
120125
outputs:
121126
- name: stdout
122127
match: '*'
@@ -152,7 +157,8 @@ For example, one of the sample [Rust Wasm filters](https://github.com/fluent/flu
152157
[0] dummy.local: [1666270589.270348000, {"lang"=>"Rust", "message"=>"dummy", "original"=>"{"message":"dummy"}", "tag"=>"dummy.local", "time"=>"2022-10-20T12:56:29.270348000 +0000"}]
153158
[0] dummy.local: [1666270590.271107000, {"lang"=>"Rust", "message"=>"dummy", "original"=>"{"message":"dummy"}", "tag"=>"dummy.local", "time"=>"2022-10-20T12:56:30.271107000 +0000"}]
154159
```
155-
Another example of a Rust Wasm filter is the [flb_filter_iis](https://github.com/kenriortega/flb_filter_iis) filter.
160+
161+
Another example of a Rust Wasm filter is the [`flb_filter_iis`](https://github.com/kenriortega/flb_filter_iis) filter.
156162

157163
This filter takes the [Internet Information Services (IIS)](https://learn.microsoft.com/en-us/iis/manage/provisioning-and-managing-iis/configure-logging-in-iis) [w3c logs](https://learn.microsoft.com/en-us/iis/manage/provisioning-and-managing-iis/configure-logging-in-iis#select-w3c-fields-to-log) (with some custom modifications) and transforms the raw string into a standard Fluent Bit JSON structured record.
158164

@@ -172,7 +178,7 @@ pipeline:
172178
wasm_path: /plugins/flb_filter_iis_wasm.wasm
173179
function_name: flb_filter_log_iis_w3c_custom
174180
accessible_paths: .
175-
181+
176182
outputs:
177183
- name: stdout
178184
match: 'iis.*'
@@ -213,6 +219,7 @@ The output after the filter logic will be:
213219
```
214220

215221
This filter approach offers several advantages inherent to programming languages. For example:
222+
216223
- It can be extended by adding type conversion to fields, such as `sc_bytes`, `cs_bytes`, and `time_taken`. You can use this to validate data results.
217224
- It allows for the use of conditions to apply more descriptive filters. For example, you can get only all logs that contain status codes higher than `4xx` or `5xx`.
218225
- It can be used to define allow lists and deny lists using a data structure array or a file to store predefined IP addresses.
@@ -254,6 +261,7 @@ AOT compiling should generate CPU architecture-dependent objects. If you want to
254261

255262
### Further examples
256263

257-
* [C filter](https://github.com/fluent/fluent-bit/tree/master/examples/filter_wasm_c)
258-
* [Rust Filter](https://github.com/fluent/fluent-bit/tree/master/examples/filter_rust)
259-
* [TinyGo filter](https://github.com/fluent/fluent-bit/tree/master/examples/filter_wasm_go)
264+
- [C filter](https://github.com/fluent/fluent-bit/tree/master/examples/filter_wasm_c)
265+
- [Rust Filter](https://github.com/fluent/fluent-bit/tree/master/examples/filter_rust)
266+
- [TinyGo
267+
filter](https://github.com/fluent/fluent-bit/tree/master/examples/filter_wasm_go)

development/wasm-input-plugins.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ There are no additional requirements to execute Wasm plugins.
1212

1313
### For Wasm programs
1414

15-
Fluent Bit supports the following Wasm toolchains:
15+
Fluent Bit supports the following Wasm tool chains:
1616

17-
* Rust on `wasm32-unknown-unknown`
18-
* rustc 1.62.1 (e092d0b6b 2022-07-16) or later
19-
* [TinyGo](https://github.com/tinygo-org/tinygo) on `wasm32-wasi`
20-
* v0.24.0 or later
21-
* [WASI SDK](https://github.com/WebAssembly/wasi-sdk) 13 or later
17+
- Rust on `wasm32-unknown-unknown`
18+
- rustc 1.62.1 (`e092d0b6b` 2022-07-16) or later
19+
- [TinyGo](https://github.com/tinygo-org/tinygo) on `wasm32-wasi`
20+
- v0.24.0 or later
21+
- [WASI SDK](https://github.com/WebAssembly/wasi-sdk) 13 or later
2222

2323
## Get started
2424

@@ -50,7 +50,7 @@ Wasm input in Fluent Bit assumes WASI ABI, also known as `wasm32-wasi` on Rust t
5050

5151
### Install additional components
5252

53-
TinyGo and WASI SDK support Wasm target by default. When using Rust's `wasm32-wasi` target, you must install `wasm32-wasi` by using [rustup](https://rustup.rs/). Then, install the target components as:
53+
TinyGo and WASI SDK support Wasm target by default. When using Rust's `wasm32-wasi` target, you must install `wasm32-wasi` by using [`rustup`](https://rustup.rs/). Then, install the target components as:
5454

5555
```text
5656
rustup target add wasm32-wasi
@@ -74,10 +74,10 @@ pipeline:
7474
tag: exec.wasi.local
7575
wasi_path: /path/to/wasi_built_json.wasm
7676
# For security reasons, WASM/WASI program cannot access its outer world
77-
# without accessible permissions. Uncomment below 'accessible_paths' and
77+
# without accessible permissions. Uncomment below 'accessible_paths' and
7878
# run Fluent Bit from the 'wasi_path' location:
7979
# accessible_paths /path/to/fluent-bit
80-
80+
8181
outputs:
8282
- name: stdout
8383
match: '*'
@@ -92,7 +92,7 @@ pipeline:
9292
Tag exec.wasi.local
9393
WASI_Path /path/to/wasi_built_json.wasm
9494
# For security reasons, WASM/WASI program cannot access its outer world
95-
# without accessible permissions. Uncomment below 'accessible_paths' and
95+
# without accessible permissions. Uncomment below 'accessible_paths' and
9696
# run Fluent Bit from the 'wasi_path' location:
9797
# accessible_paths /path/to/fluent-bit
9898

@@ -104,4 +104,5 @@ pipeline:
104104
{% endtab %}
105105
{% endtabs %}
106106

107-
For an example that handles structured logs, see the [Rust `serde-json` example](https://github.com/fluent/fluent-bit/tree/master/examples/wasi_serde_json).
107+
For an example that handles structured logs, see the [Rust `serde-json`
108+
example](https://github.com/fluent/fluent-bit/tree/master/examples/wasi_serde_json).

vale-styles/FluentBit/Headings.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ exceptions:
5757
- GCP
5858
- GitLab
5959
- GitHub
60+
- Go
6061
- Google
6162
- Google Cloud
6263
- Google Cloud BigQuery
@@ -85,6 +86,7 @@ exceptions:
8586
- LTSV
8687
- macOS
8788
- Marketplace
89+
- MessagePack
8890
- Microsoft Fabric
8991
- MongoDB
9092
- NATS
@@ -127,6 +129,7 @@ exceptions:
127129
- Visual
128130
- Vivo Exporter
129131
- VS
132+
- Wasm
130133
- WebSocket
131134
- Windows
132135
- YAML

0 commit comments

Comments
 (0)