Cloud Native Logging / Fluentd Summit Tokyo

63
Cloud Native Logging Fluentd Summit, June 01th, 2017 - Japan Eduardo Silva @edsiper [email protected]

Transcript of Cloud Native Logging / Fluentd Summit Tokyo

Page 1: Cloud Native Logging / Fluentd Summit Tokyo

Cloud Native Logging

Fluentd Summit, June 01th, 2017 - JapanEduardo Silva @[email protected]

Page 2: Cloud Native Logging / Fluentd Summit Tokyo

“Logging... Why?”

Page 3: Cloud Native Logging / Fluentd Summit Tokyo

Logging: Why ?

Analyze Applications Behavior

Page 4: Cloud Native Logging / Fluentd Summit Tokyo

Logging: Why ?

Analyze Applications Behavior

Page 5: Cloud Native Logging / Fluentd Summit Tokyo

Logging: Why ?

Page 6: Cloud Native Logging / Fluentd Summit Tokyo

Logging: Why ?

Page 7: Cloud Native Logging / Fluentd Summit Tokyo

Logging Pipeline

Page 8: Cloud Native Logging / Fluentd Summit Tokyo

Logging Pipeline

Page 9: Cloud Native Logging / Fluentd Summit Tokyo

Logging Pipeline

Page 10: Cloud Native Logging / Fluentd Summit Tokyo

It’s a mess

Page 11: Cloud Native Logging / Fluentd Summit Tokyo

“Logging... Why?”(Micro Services)

Page 12: Cloud Native Logging / Fluentd Summit Tokyo

OK, Where’s My Log in Container Era?

Page 13: Cloud Native Logging / Fluentd Summit Tokyo

Logging hasNever Been Easier

Page 14: Cloud Native Logging / Fluentd Summit Tokyo
Page 15: Cloud Native Logging / Fluentd Summit Tokyo

About Fluentd

● Invented by

● Now hosted at

Page 16: Cloud Native Logging / Fluentd Summit Tokyo

Logging Pipeline

Page 17: Cloud Native Logging / Fluentd Summit Tokyo

How Fluentd Simplifies Logging Pipeline

Page 18: Cloud Native Logging / Fluentd Summit Tokyo

How Fluentd Simplifies Unified Logging Layer

Page 19: Cloud Native Logging / Fluentd Summit Tokyo

About Fluentd

● More than 600 plugins available

● Pluggable Architecture

● Built-in Reliability

● Full integration with Docker and Kubernetes

● Written in Ruby + C

Page 20: Cloud Native Logging / Fluentd Summit Tokyo

Fluentd Plugin Ecosystem

Page 21: Cloud Native Logging / Fluentd Summit Tokyo

Fluentd Modular Architecture

Page 22: Cloud Native Logging / Fluentd Summit Tokyo

Fluentd Structured Logging

Page 23: Cloud Native Logging / Fluentd Summit Tokyo

Fluentd at Scale

Page 24: Cloud Native Logging / Fluentd Summit Tokyo

Kubernetes & Fluentd

Page 25: Cloud Native Logging / Fluentd Summit Tokyo

Kubernetes 101

Page 26: Cloud Native Logging / Fluentd Summit Tokyo

Kubernetes 101

Page 27: Cloud Native Logging / Fluentd Summit Tokyo

Kubernetes 101

Page 28: Cloud Native Logging / Fluentd Summit Tokyo

Kubernetes 101

Page 29: Cloud Native Logging / Fluentd Summit Tokyo

Kubernetes 101

Page 30: Cloud Native Logging / Fluentd Summit Tokyo

Kubernetes 101

Page 31: Cloud Native Logging / Fluentd Summit Tokyo

Fluentd Deployment: DaemonSet

Page 32: Cloud Native Logging / Fluentd Summit Tokyo

Kubernetes: Fluentd Log Collection

Page 33: Cloud Native Logging / Fluentd Summit Tokyo

Fluentd: Enrich Logs with Kubernetes Metadata

Page 34: Cloud Native Logging / Fluentd Summit Tokyo

Storing the Logs

Page 35: Cloud Native Logging / Fluentd Summit Tokyo

Example: Logs from the Container

Page 36: Cloud Native Logging / Fluentd Summit Tokyo

Logs Stored by Fluentd

Page 37: Cloud Native Logging / Fluentd Summit Tokyo

Fluentd: Error Handling

Page 38: Cloud Native Logging / Fluentd Summit Tokyo

Fluentd: Retrying

Page 39: Cloud Native Logging / Fluentd Summit Tokyo

Fluentd: Kubernetes DaemonSet

Pre-built Yaml file https://github.com/fluent/fluentd-kubernetes-daemonset/

Page 40: Cloud Native Logging / Fluentd Summit Tokyo

Extending the Fluentd Ecosystem

Page 41: Cloud Native Logging / Fluentd Summit Tokyo

Fluentd Modes

● Log Forwarder

● Log Aggregator

Page 42: Cloud Native Logging / Fluentd Summit Tokyo

Log Aggregator = (Forwarder + Buffering Capabilities)

Page 43: Cloud Native Logging / Fluentd Summit Tokyo

Edge Nodes / Forward to Aggregators

App

Node 1

DB

App DB

Page 44: Cloud Native Logging / Fluentd Summit Tokyo

Edge Nodes & Costs

Page 45: Cloud Native Logging / Fluentd Summit Tokyo

Edge Nodes & Costs

● Fluentd requires ~40MB as minimum

● Deploying a few hundred could be expensive

● Can we make Forward cheaper ?

Page 46: Cloud Native Logging / Fluentd Summit Tokyo

Forwarder & Aggregator

Log Forwarder Log Aggregator

Page 47: Cloud Native Logging / Fluentd Summit Tokyo
Page 48: Cloud Native Logging / Fluentd Summit Tokyo

About Fluent Bit

● Written in C

● Pluggable Architecture

● Built-in Reliability

● Event Driven - Async I/O

Page 49: Cloud Native Logging / Fluentd Summit Tokyo

Why Fluent Bit as a Forwarder

● Features

○ Input, Filter and Output Plugins

○ Built-in parsing support

○ Minimum memory required 450KB

Page 50: Cloud Native Logging / Fluentd Summit Tokyo

Edge Nodes / Forward to Aggregators

Page 51: Cloud Native Logging / Fluentd Summit Tokyo

Cheap Forwarding

Page 52: Cloud Native Logging / Fluentd Summit Tokyo

Cloud Native Features

● Backpressure Handling

● Security

● Kubernetes Metadata Filter

● Timestamps w/Nanoseconds (upcoming v0.12)

Page 53: Cloud Native Logging / Fluentd Summit Tokyo

Cloud Native Features

● Backpressure

Page 54: Cloud Native Logging / Fluentd Summit Tokyo

Cloud Native Features

● Backpressure

Page 55: Cloud Native Logging / Fluentd Summit Tokyo

Cloud Native Features

● Backpressure

Page 56: Cloud Native Logging / Fluentd Summit Tokyo

Cloud Native Features

● Backpressure

Page 57: Cloud Native Logging / Fluentd Summit Tokyo

Cloud Native Features

● Backpressure Solved

Page 58: Cloud Native Logging / Fluentd Summit Tokyo

Security

● Native integration for TLS/SSL

■ Optional for plugins with network I/O■ Certificates support

Page 59: Cloud Native Logging / Fluentd Summit Tokyo

Features, plugins and more

● Plugins (~30)

○ Input■ cpu, disk, forward, mem, syslog, tcp, kmsg...

○ Filter■ Grep, Kubernetes & Record Modifier

○ Output■ Elasticsearch, HTTP, InfluxDB, Forward, Treasure Data

Page 60: Cloud Native Logging / Fluentd Summit Tokyo

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 61: Cloud Native Logging / Fluentd Summit Tokyo

Let’s “try” a demo

● Minikube!Disclaimer: I had the great idea to upgrade minutes ago!!!! :O

Page 62: Cloud Native Logging / Fluentd Summit Tokyo

Fluent Bit Kubernetes DaemonSet

Github Repository

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

Docker Hub Image

● fluent/fluent-bit-kubernetes-daemonset

Page 63: Cloud Native Logging / Fluentd Summit Tokyo

Fluent Bit

Project information

● Web site fluentbit.io ● Github fluent/fluent-bit

Contact / Community

● Slack http://slack.fluentd.org