unifying events and logs into the cloud

60
Eduardo Silva [email protected] @edsiper Unifying Events & Logs into the Cloud October 06, 2015 StartechConf, Santiago

Upload: eduardo-silva-pereira

Post on 15-Feb-2017

266 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: Unifying Events and Logs into the Cloud

Eduardo [email protected]

@edsiper

Unifying Events & Logs into the Cloud

October 06, 2015StartechConf, Santiago

Page 2: Unifying Events and Logs into the Cloud

About MeEduardo 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

Page 3: Unifying Events and Logs into the Cloud

Logging

Page 4: Unifying Events and Logs into the Cloud

Logging MattersPros

● Application status

● Debugging

● General information about anomalies: errors

● Troubleshooting / Support

● Local or Remote (network)

Page 5: Unifying Events and Logs into the Cloud

Logging MattersFrom a business point of view

● Input data Analytics→

● User interaction / behaviors

● Improvements

Page 6: Unifying Events and Logs into the Cloud

Assumptions

Page 7: Unifying Events and Logs into the Cloud

Logging MattersAssumptions

● I have enough disk space

● I/O operations will not block

● Log messages are human readable

● My logging mechanism scale

Page 8: Unifying Events and Logs into the Cloud

Logging MattersAssumptions

Basically, yeah.. it should work.

Page 9: Unifying Events and Logs into the Cloud

Concerns

Page 10: Unifying Events and Logs into the Cloud

Logging MattersConcerns

● Logs increase = data increase

● Message format get more complex

● Did the Kernel flush the buffers ? (sync(2))

● Multi-thread application ?, locking ?

● Multiple Applications = Multiple Logs

Page 11: Unifying Events and Logs into the Cloud

Logging MattersConcerns

If Multiple Applications = Multiple logs

Multiple Hosts x Multiple Applications = ???

Page 12: Unifying Events and Logs into the Cloud

OK, so:

1. Logging matters2. It's really beneficial3. but...

Page 13: Unifying Events and Logs into the Cloud

It needs to be done right.

Page 14: Unifying Events and Logs into the Cloud

LoggingCommon sources & inputs

● Application Logs

● Apache● NginX● Syslog (-ng)

● Custom applications / Languages

● C, Ruby, Python, PHP, Perl, NodeJS, Java, etc.

Page 15: Unifying Events and Logs into the Cloud

In a galaxy not so far away...

Page 16: Unifying Events and Logs into the Cloud
Page 17: Unifying Events and Logs into the Cloud

How to parse/storemultiple data sources ?

note: performance matters!

Page 18: Unifying Events and Logs into the Cloud
Page 19: Unifying Events and Logs into the Cloud

Fluentd is an open source data collector

It let's you unify the data collection for a better use and understanding of data.

Page 20: Unifying Events and Logs into the Cloud

before

Page 21: Unifying Events and Logs into the Cloud

after

Page 22: Unifying Events and Logs into the Cloud

FluentdHighlights

● High Performance

● Built-in Reliability

● Structured Logs

● Pluggable Architecture

● More than 300 plugins! (input/filtering/output)

Page 23: Unifying Events and Logs into the Cloud

FluentdArchitecture

Page 24: Unifying Events and Logs into the Cloud

FluentdInternals simplified

Page 25: Unifying Events and Logs into the Cloud

FluentdInput plugins

Page 26: Unifying Events and Logs into the Cloud

FluentdOutput plugins

Page 27: Unifying Events and Logs into the Cloud

FluentdBuffer plugins

Page 28: Unifying Events and Logs into the Cloud

FluentdBuffer plugins

Page 29: Unifying Events and Logs into the Cloud
Page 30: Unifying Events and Logs into the Cloud

M x N M + N→

Page 31: Unifying Events and Logs into the Cloud

FluentdSimple Forwarding

Page 32: Unifying Events and Logs into the Cloud

FluentdSimple Forwarding: configuration

# logs from a file # store logs to MongoDB<source> <match backend.*> type tail type mongo path /var/log/httpd.log database fluent format apache2 collection test tag backend.apache </match></source>

# logs from client libraries<source> type forward port 24224</source>

Page 33: Unifying Events and Logs into the Cloud

FluentdLess Simple Forwarding

Page 34: Unifying Events and Logs into the Cloud

FluentdLambda Architecture

Page 35: Unifying Events and Logs into the Cloud

Fluentd# logs from a file # store logs to MongoDB<source> <match *.*> type tail type copy path /var/log/httpd.log <store> format apache2 type elasticsearch tag backend.apache logstash_format true</source> </store> # logs from client libraries <store><source> type webhdfs type forward host 192.x.y.z port 24224 port 50070</source> path /path/to/hdfs </store> </match>

Page 36: Unifying Events and Logs into the Cloud

Who uses Fluentd in production ?

Page 37: Unifying Events and Logs into the Cloud
Page 38: Unifying Events and Logs into the Cloud
Page 39: Unifying Events and Logs into the Cloud

We collect 1M events per second !

Page 40: Unifying Events and Logs into the Cloud

Internet of Things

Page 41: Unifying Events and Logs into the Cloud

Internet of ThingsFacts

● 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.

Page 42: Unifying Events and Logs into the Cloud

Internet of ThingsAlliances

Vendors formed alliances to join forces and develop generic software layers for their products:

Page 43: Unifying Events and Logs into the Cloud

Internet of ThingsSolutions provided

Alliance Framework

Page 44: Unifying Events and Logs into the Cloud

IoT & Big DataAnalytics

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 or other. How do we collect and unify data properly ?

Page 45: Unifying Events and Logs into the Cloud

@fluentbit

Page 46: Unifying Events and Logs into the Cloud

Fluent Bit is an open sourcedata collector

It let's you collect data from IoT/Embedded devices and transport It to third party services.

Page 47: Unifying Events and Logs into the Cloud

Fluent BitTargets

● Services

● Sensors / Signals / Radios

● Operating System information

● Automotive / Telematics

Page 48: Unifying Events and Logs into the Cloud

Fluent BitRequirements

IoT and Embedded environment requires special handling,specifically on performance and resource utilization:

● Lightweight

● Written in C Language

● Customizable, pluggable architecture

● Full integration with Fluentd

Page 49: Unifying Events and Logs into the Cloud

Fluent BitIntegration

Page 50: Unifying Events and Logs into the Cloud

Fluent BitDirect Output

Page 51: Unifying Events and Logs into the Cloud

Containers

Page 52: Unifying Events and Logs into the Cloud
Page 53: Unifying Events and Logs into the Cloud

DockerLogging driver

● Docker v1.6 released the concept of logging drivers

● Route container output

● Fluentd ?

Page 54: Unifying Events and Logs into the Cloud

Docker

Page 55: Unifying Events and Logs into the Cloud

Docker v1.8Fluentd Logging driver!

Page 56: Unifying Events and Logs into the Cloud

DockerData Stream

Page 57: Unifying Events and Logs into the Cloud

DockerData Stream

Page 58: Unifying Events and Logs into the Cloud
Page 59: Unifying Events and Logs into the Cloud

NodeJSFluent-Logger (NPM)

Page 60: Unifying Events and Logs into the Cloud

We Love Data!

Thank you!

● http://fluentd.org

● http://fluentbit.io

● https://docs.docker.com/reference/logging/fluentd/

● http://github.com/fluent/fluentd