Eduardo Silva
eduardo@treasuredata.com
@edsiper
Fluent Bit
September 08, 2015
Treasure Hunter School
About Me
Eduardo Silva
●
Github & Twitter @edsiper
●
Personal Blog http://edsiper.linuxchile.cl
Treasure Data
●
Open Source Engineer
●
Fluentd / Fluent Bit http://github.com/fluent
Projects
●
Monkey HTTP Server http://monkey-project.com
●
Duda I/O http://duda.io
Embedded World
Embedded World
It's not new...
●
Embedded systems have been around for
decades: automotive, medical devices, cameras, etc.
●
Hardware resources are very limited.
●
Embedded is emerging within a new concept: IoT
Internet of Things
Internet of Things
Facts
●
IoT will grow to many billions of devices over the
next decade.
●
Now it's about device to device connectivity.
●
Different frameworks and protocols are emerging.
●
It needs Logging.
Internet of Things
Alliances
Vendors formed alliances to join forces and develop
generic software layers for their products:
Internet of Things
Solutions provided
Alliance Framework
→
→
IoT and Big Data
Analytics
IoT requires a generic solution to collect events and
data from different sources for further analysis.
Data can come from a specific framework, radio device,
sensor and others. How do we collect and unify data
properly ?
Internet of Things
Market needs
The IoT market is growing and the device to device
connectivity is a must, for hence a strong and fair
software platform is required for a reliable system.
IoT Software Layers
Interoperability
Hardware vendors are aware that interoperability with
third party products is a success key. A generic
software layer across products is the answer.
In a galaxy
not so far away...
@fluentbit
Fluent Bit is an open source
data collector
It let's you collect data from IoT/Embedded
devices and transport It to third party
services.
Fluent Bit
Targets
●
Services
●
Sensors / Signals / Radios
●
Operating System information
●
Automotive / Telematics
Fluent Bit
Requirements
IoT and Embedded environment requires special
handling, specifically on performance and resources:
●
Lightweight
●
Written in C Language
●
Customizable, pluggable architecture
●
Full integration with Fluentd
Fluent Bit
I/O
Fluent Bit
Integration with Fluentd
Fluent Bit
Direct Output
Fluent Bit
and Fluentd
Fluentd Fluent Bit
Scope Servers Embedded & IoT devices
Language C & Ruby C
Performance High Performance High Performance
Dependencies Built as a Ruby Gem, it
requires a certain number of
gems.
Zero dependencies, unless some
special plugin requires them.
Plugins More than 300 plugins
available
Less than 10 plugins available
Architecture
Architecture
Global Overview
Architecture
Core Engine
●
Everything related to initialization.
●
Interface plugins.
●
Abstract network operations.
●
Make the magic happens.
Architecture
Plugins
●
Abstraction level between the Engine
and data handlers.
●
Provide registration mechanism.
●
Expose callbacks used in the Engine
event loop.
Architecture
Input Plugins
●
Collect data.
●
Behave as a network service, built-in
metric or generator.
●
It runs at intervals of time (triggered
by the Engine) or upon file descriptor
events.
Architecture
Input Plugins (as of 0.2 dev)
xbee get messages from XBee radio devices.
cpu metric plugin, gather and calculate CPU
usage.
mem metric plugin, gather system memory usage.
kmsg get messages from the Linux Kernel Log.
serial get messages from the Serial input interface.
stdin get messages from the standard input
interface.
mqtt MQTT TCP server, get publish messages.
Architecture
Output Plugins
●
Take buffered data and enqueue it
for delivery.
●
Handle plugins
●
Provides the main event loop.
●
Architecture
Output Plugins
fluentd Forward messages to Fluentd over TCP.
td Upload data to Treasure Data service.
stdout Print messages to the standard output.
Architecture
Stack Providers
Fluent Bit have three dependencies
which are distributed in the source
code and are linked statically.
These components are helpers for
the Engine and Plugins Manager.
Architecture
MessagePack
MessagePack is an efficient binary
serialization format. This component
is heavily used to pack JSON into a
binary version.
Architecture
mbedTLS
mbedTLS provides a Transport
Layer Security (TLS) for network
operations, for short, It provides TLS
and SSL encryption for network
operations that require secure
channels.
Architecture
Monkey
Monkey is a web server that provides
an embeddable HTTP stack and some
extra routines to handle configuration
files, memory handling, event loops,
string manipulation within others.
Architecture
Library Mode
Architecture
Library Mode
Architecture
Configuration Schema
Fluent Bit
Development
Contributors Takeshi Hasegawa, Masaya Yamamoto, Naoya Kaneko within others
Fluent Bit
Documentation
Fluent Bit
Thank you!
●
http://fluentbit.io
●
http://github.com/fluent/fluentd
●
http://twitter.com/fluentbit

Fluent Bit