Eric D. Schabell: Telemetry Pipelines Workshop - Installing Fluent Bit from Source

Thursday, March 7, 2024

Telemetry Pipelines Workshop - Installing Fluent Bit from Source

Are you ready for getting started with cloud native observability with telemetry pipelines? 

This article is part of a series exploring a workshop guiding you through the open source project Fluent Bit, what it is, a basic installation, and setting up a first telemetry pipeline project. Learn how to manage your cloud native data from source to destination using the telemetry pipeline phases covering collection, aggregation, transformation, and forwarding from any source to any destination. 

The previous article in this series provided an introduction to Fluent Bit where we gain an understanding of its role in the cloud native observability world. This article dives into the installation of Fluent Bit on your local machine using the project source code. You can find more details in the accompanying workshop lab.

It's easy enough to go to the Fluent Bit project site and sort through the documentation to build the project from scratch, but I've always been partial to providing an easy installation project that is entirely self-contained. 

We only need to use this with a single command to run dependency checks and build the project from source on your local machine. 

Easy install project

Installing on your local machine can be done in just a few steps with our Fluent Bit Easy Install project. This contains the source code from a released version of Fluent Bit, see readme for the exact version, and uses a simple automated installation script.

It takes just 3 steps to a running server:

  • Download and unzip the easy install project
  • Run the init.sh file in a console.
  • Test install by running a version check (fluent-bit --version).

The first step is to download the project. Unzipping (use your file manager or console) should look something like the following.

$ unzip fluentbit-install-demo-v1.1.zip

Archive: fluentbit-install-demo-v1.1.zip
creating: fluentbit-install-demo-v1.1/
extracting: fluentbit-install-demo-v1.1/.gitignore
inflating: fluentbit-install-demo-v1.1/README.md
creating: fluentbit-install-demo-v1.1/docs/
creating: fluentbit-install-demo-v1.1/docs/demo-images/
inflating: fluentbit-install-demo-v1.1/docs/demo-images/workshop.png
inflating: fluentbit-install-demo-v1.1/init.bat
inflating: fluentbit-install-demo-v1.1/init.sh
creating: fluentbit-install-demo-v1.1/installs/
inflating: fluentbit-install-demo-v1.1/installs/README
inflating: fluentbit-install-demo-v1.1/installs/fluent-bit-3.0.1.zip
creating: fluentbit-install-demo-v1.1/support/
extracting: fluentbit-install-demo-v1.1/support/README
inflating: fluentbit-install-demo-v1.1/support/functions.sh

inflating: fluentbit-install-demo-v1.1/support/unzip.vbs

After unzipping you can start the installation by running the init.sh script found in the project root directory. Note there is an init.bat for windows environments, but this is yet untested (I don't have a windows machine). Please feel free to use and test for me, other users would be super happy with any fixes you might provide.

The install script needs an argument source to indicate you are building the Fluent Bit project from source.

$ ./init.sh source

################################################################
##                                                            ##
##  Setting up the Fluent Bit Easy Install demo               ##
##                                                            ##
##      ##### #   # ##### #   # #####   ####  ##### #####     ##
##      #     #   # #     ##  #   #     #   #   #     #       ##
##      ####  #   # ###   # # #   #     ####    #     #       ##
##      #     #   # #     #  ##   #     #   #   #     #       ##
##      #     ##### ##### #   #   #     ####  #####   #       ##
##                                                            ##
##                #####  ###   #### #   #                     ##
##                #     #   # #      # #                      ##
##                ###   #####  ###    #                       ##
##                #     #   #     #   #                       ##
##                ##### #   # ####    #                       ##
##                                                            ##
##        ##### #   #  #### #####  ###  #     #               ##
##          #   ##  # #       #   #   # #     #               ##
##          #   # # #  ###    #   ##### #     #               ##
##          #   #  ##     #   #   #   # #     #               ##
##        ##### #   # ####    #   #   # ##### #####           ##
##                                                            ##
##  brought to you by Eric D. Schabell                        ##
##                                                            ##
##  git@gitlab.com:o11y-workshops/fluentbit-install-demo.git  ##
##                                                            ##
################################################################

A bit of fun ASCII art is presented to kick off the installation, followed by some checks to make sure you have the dependencies needed to build Fluent Bit. Should any fail, you will be pointed to installation help. Here below all checks are passing (noting your versions reported might be different, as long as they pass).

...

Checking the build mode arguments...

Installing from source...

Installing Fluent Bit version 3.0.1 from the source project...

  - removing existing installation directory...

Checking for bison version needed to build:

Bison major version is good...

...

As you scroll further down the output, you see Fluent Bit is installed into the target directory. We then run phase one of building the project.

...

Unpacking Fluent Bit project into target directory...

Fluent Bit project unpacked successfully into target directory!

Moving to the Fluent Bit project build directory...

Building Fluent Bit (phase 1):
[BUILDING_CODE_STARTS_HERE]

...

Eventually (cut out of the log here due to length of the build), the build phase one should complete and you'll see the message below as it continues on to phase two of the build.

...

-- Configuring done (21.9s)
-- Generating done (1.3s)
-- Build files have been written to: fluentbit-install-demo/target/fluent-bit-3.0.1/build

Phase 1 build successful, building continuing with phase 2:
[BUILDING_CODE_CONTINUES_HERE]
...

When phase two completes successfully the next step is to copy the build binaries to our target execution directory.

...

Fluent Bit built successfully!

Copying to ./target/fluent-bit-3.0.1/bin for use.

...

Finally, Fluent Bit is ready to use.

=============================================================
=                                                           =
=  Install complete, get ready to rock Fluent Bit!          =
=                                                           =
=  The binary build is available to run at:                 =
=                                                           =
=  $ cd target/fluent-bit-3.0.1/bin/fluent-bit              =
=  $ bin/fluent-bit --version                               =
=                                                           =
=   Fluent Bit v3.0.1                                       =
=                                                           =
=  Getting started workshop available online:               =
=  https://o11y-workshops.gitlab.io/workshop-fluentbit      =
=                                                           =
=============================================================

Here you see the end report with the final instructions on where to find the executable and how to test it by checking its version.

Testing the install

To verify that the source code was installed, you can run the following from a console or terminal window and see that the version of Fluent Bit works!

$ cd target/fluent-bit-3.0.1/bin/fluent-bit
$ bin/fluent-bit --version

Fluent Bit v3.0.1

In this case we are using Fluent Bit version 3.0.1, and in the following articles we'll start building our first telemetry pipelines.

What's next?

This article helped us get Fluent Bit installed on our local machine using the project source code. The series continues with the next step in this workshop, installing Fluent Bit on your local machine using container images.

Stay tuned for more hands on material to help you with your cloud native observability journey.