log forwarding at scale - scale 18x | 18x...about fluentd more than 600 plugins available pluggable...

44
Log Forwarding at Scale Scale 15X, Pasadena, CA Eduardo Silva (@edsiper) [email protected]

Upload: others

Post on 20-May-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Log Forwarding at Scale

Scale 15X, Pasadena, CAEduardo Silva (@edsiper)[email protected]

Page 2: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

/about

● Open Source Engineer at Treasure Data

● Repositories / Projects

○ github.com/edsiper○ fluentbit.io○ duda.io○ monkey-project.com

Page 3: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

“Logging is Simple”

Page 4: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

“Logging is Simple”

Page 5: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

“Logging is Simple”

Logs App Analysis

Logging exists because of Analysis needs

Page 6: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Before Analysis

Logs Database

Someone have to do some work

?

Page 7: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

In a galaxy not so far away...

Logs Database

Page 8: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Analysis

Page 9: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Internally, Logging is not Simple

Page 10: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Scale Logging Requires Understanding

Page 11: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Logging Pipeline

Page 12: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Logging Pipeline

Log Messages Parse Filter Buffer

Routing

Elasticsearch

InfluxDB

Others

Page 13: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Logging Pipeline

Log Messages Parse Filter Buffer

Routing

Elasticsearch

InfluxDB

Others

● Log files● Journald● TCP

Page 14: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Logging Pipeline

Log Messages Parse Filter Buffer

Routing

Elasticsearch

InfluxDB

Others

Format / Structure:

● JSON● Regex / Named Capture

Page 15: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Logging Pipeline

Log Messages Parse Filter Buffer

Routing

Elasticsearch

InfluxDB

Others

Alter content: Grep, Exclude, Metadata

Page 16: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Logging Pipeline

Log Messages Parse Filter Buffer

Routing

Elasticsearch

InfluxDB

Others

Memory / Filesystem

Page 17: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Logging Pipeline

Log Messages Parse Filter Buffer

Routing

Elasticsearch

InfluxDB

OthersDeliver buffers to N destinations

Logging Pipeline

Page 18: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Logging Pipeline

Log Messages Parse Filter Buffer

Routing

Elasticsearch

InfluxDB

Others

Logging Pipeline

Page 19: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Logging Pipeline

● How to deal with the Logging Pipeline ?

● Is there any solution around ?

Page 20: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written
Page 21: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

About Fluentd

● Created by

● Now hosted at

Page 22: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

About Fluentd

● More than 600 plugins available

● Pluggable Architecture

● Built-in Reliability

● Full integration with Docker and Kubernetes

● Written in Ruby + C

Page 23: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Fluentd Modes

● Log Forwarder

● Log Aggregator

Page 24: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Log Aggregator = (Forwarder + Buffering Capabilities)

Page 25: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Edge Nodes / Forward to Aggregators

App

Node 1

DB

App DB

Page 26: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Edge Nodes & Costs

Page 27: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Edge Nodes & Costs

● Fluentd requires ~40MB as minimum

● Deploying a few hundred could be expensive

● Can we make Forward cheaper ?

Page 28: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Forwarder & Aggregator

Log Forwarder Log Aggregator

Page 29: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written
Page 30: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

About Fluentd

● Written in C

● Pluggable Architecture

● Built-in Reliability

● Event Driven - Async I/O

Page 31: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Why Fluent Bit as a Forwarder

● Features

○ Input, Filter and Output Plugins

○ Built-in parsing support

○ Minimum memory required 450KB

Page 32: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Edge Nodes / Forward to Aggregators

Page 33: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Cheap Forwarding

Page 34: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Cloud Native Features

● Docker & Kubernetes Support

● Buffering fully controled○ pause() / resume() for input plugins

● Easy to containerize○ Small memory footprint○ No dependencies (all are built-in)

Page 35: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Hands on!

DEMO #1

Unstructured vs Structured data

Page 36: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Unstructured v/s Structured

● Why

○ Structured data have a schema

○ Easy to convert to different representations

○ It can be filtered

Page 37: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Hands on!

DEMO #2

Process Docker Logs

Page 38: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Kubernetes use case

● Applications runs in Containers

● Containers runs in a POD

● Multiple PODs can exists in a Node

● How to solve logging ?

Page 39: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Hands on!

DEMO #3Kubernetes: parse logs and append Metadata

API Server Nodes

Page 40: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Kubernetes

Metadata Support Status

The new kubernetes filter takes care of the following metadata handling:

○ Local data: POD Name, Namespace, Container Name and Container ID.

○ Remote (API Server): Labels and Annotations

Page 41: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Fluent Bit, what else ?

Networking and Co-routines

Easier implementation of output plugins that interact with networking operations like socket(), connect(), read(), write(), etc.

Fluent Bit provides non-blocking networking API that uses the event-loop with co-routines to implement:

● Network I/O● TLS/SSL usage● HTTP Client

Page 42: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Kubernetes DaemonSet

Github Repository

● https://github.com/fluent/fluent-bit-kubernetes-daemonset

Docker Image (ubuntu-slim)

● quay.io/fluent/fluent-bit-kubernetes-daemonset

Page 43: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Roadmap

Next Release v0.11 (March 2017)

● Kubernetes support (filter_kubernetes)● Parsers & Filters● Memory optimizations

Release v0.12 (May 2017)

● in_tail + Multiline support● Monitoring - re-enable HTTP service end-point: memory, records

flow, others.

Page 44: Log Forwarding at Scale - SCALE 18x | 18x...About Fluentd More than 600 plugins available Pluggable Architecture Built-in Reliability Full integration with Docker and Kubernetes Written

Thanks!

Project information

● Web site Fluentbit.io● Documentation http://fluentbit.io/documentation/● Github http://github.com/fluent/fluent-bit

Contact

● Slack http://slack.fluentd.org (fluent-bit channel)● Twitter @fluentbit