Skip to content

Commit 5631feb

Browse files
Merge pull request #1663 from fluent/alexakreizinger/sc-123166/update-development-wasm-input-plugins-doc
2 parents dd264fc + 2b59bc1 commit 5631feb

File tree

1 file changed

+22
-26
lines changed

1 file changed

+22
-26
lines changed

development/wasm-input-plugins.md

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
1-
# WASM Input Plugins
1+
# Wasm input plugins
22

3-
[WebAssembly](https://webassembly.org/) is binary instruction format for stack based virtual machine.
3+
[WebAssembly](https://webassembly.org/) (Wasm) is a binary instruction format for stack-based virtual machines.
44

5-
Fluent Bit currently supports integration of wasm plugins built as wasm/wasi objects for input and filter plugins only.
6-
The interface for the WASM filter plugins is currently under development but is functional.
5+
Fluent Bit supports integration of Wasm plugins built as Wasm/WASI objects for inputs and filter plugins only. The interface for Wasm filter plugins is currently under development but is functional.
76

87
## Prerequisites
98

10-
### Building Fluent Bit
9+
### Build Fluent Bit
1110

12-
There are no additional requirements to execute WASM plugins.
11+
There are no additional requirements to execute Wasm plugins.
1312

14-
### For Build WASM programs
13+
### For Wasm programs
1514

16-
Currently, fluent-bit supports the following WASM toolchains:
15+
Fluent Bit supports the following Wasm toolchains:
1716

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

24-
## Getting Started
23+
## Get started
2524

26-
Compile Fluent Bit with WASM support, e.g:
25+
Compile Fluent Bit with Wasm support. For example:
2726

2827
```text
2928
$ cd build/
3029
$ cmake ..
3130
$ make
3231
```
3332

34-
Once compiled, we can see new plugins in which handles _wasm_, e.g:
33+
Once compiled, you can see new plugins that handle `wasm`. For example:
3534

3635
```text
3736
$ bin/fluent-bit -h
@@ -45,28 +44,25 @@ Filters
4544
wasm WASM program filter
4645
```
4746

48-
## Build a WASM Input for Input Plugin
47+
## Build a Wasm input for input plugin
4948

50-
Currently, Fluent Bit's WASM input assumes WASI ABI that is also known as `wasm32-wasi` on Rust target and `wasm32-wasi` on TinyGo target.
49+
Wasm input in Fluent Bit assumes WASI ABI, also known as `wasm32-wasi` on Rust target and `wasm32-wasi` on TinyGo target.
5150

52-
### To Install Additional Components
51+
### Install additional components
5352

54-
TinyGo and WASI SDK support wasm target by default.
55-
When using Rust's `wasm32-wasi` target, users must install `wasm32-wasi` via [rustup](https://rustup.rs/). Then, installing that 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:
5654

5755
```text
5856
$ rustup target add wasm32-wasi
5957
```
6058

61-
### Requirements of WASM/WASI programs
59+
### Requirements of Wasm/WASI programs
6260

63-
WASM input plugins execute the function that has wasi main function entrypoint.
64-
And Fluent Bit's WASM input plugin communicates via stdout on WASM programs.
61+
Wasm input plugins execute the function that has a WASI main function entrypoint, and Wasm input plugins in Fluent Bit communicate through stdout on Wasm programs.
6562

66-
WASM programs should handle stdout for ingesting logs into Fluent Bit.
63+
Wasm programs should handle stdout for ingesting logs into Fluent Bit.
6764

68-
69-
Once built, a WASM/WASI program will be available. Then, that built program can be executed with the following Fluent Bit configuration:
65+
Once built, a Wasm/WASI program will be available. Then you can execute that built program with the following Fluent Bit configuration:
7066

7167
```text
7268
[INPUT]
@@ -82,4 +78,4 @@ Once built, a WASM/WASI program will be available. Then, that built program can
8278
Match *
8379
```
8480

85-
For further example that handles structured logs, fluent-bit has a Rust serde-json example: https://github.com/fluent/fluent-bit/tree/master/examples/wasi_serde_json
81+
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).

0 commit comments

Comments
 (0)