Fluentd Intro for OpenShift Commons Briefing

59
Cloud Native Logging OpenShift Commons Briefing, April 20th 2017 Eduardo Silva @edsiper [email protected]

Transcript of Fluentd Intro for OpenShift Commons Briefing

Page 1: Fluentd Intro for OpenShift Commons Briefing

Cloud Native Logging

OpenShift Commons Briefing, April 20th 2017Eduardo Silva @[email protected]

Page 2: Fluentd Intro for OpenShift Commons Briefing

“Logging... Why?”

Page 3: Fluentd Intro for OpenShift Commons Briefing

Logging: Why ?

Analyze Applications Behavior

Page 4: Fluentd Intro for OpenShift Commons Briefing

Logging: Why ?

Analyze Applications Behavior

Page 5: Fluentd Intro for OpenShift Commons Briefing

Logging: Why ?

Page 6: Fluentd Intro for OpenShift Commons Briefing

Logging: Why ?

Page 7: Fluentd Intro for OpenShift Commons Briefing

Logging Pipeline

Page 8: Fluentd Intro for OpenShift Commons Briefing

Logging Pipeline

Page 9: Fluentd Intro for OpenShift Commons Briefing

Logging Pipeline

Page 10: Fluentd Intro for OpenShift Commons Briefing

It’s a mess

Page 11: Fluentd Intro for OpenShift Commons Briefing

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

Page 12: Fluentd Intro for OpenShift Commons Briefing

OK, Where’s My Log in Container Era?

Page 13: Fluentd Intro for OpenShift Commons Briefing

Logging hasNever Been Easier

Page 14: Fluentd Intro for OpenShift Commons Briefing
Page 15: Fluentd Intro for OpenShift Commons Briefing

About Fluentd

● Invented by

● Now hosted at

Page 16: Fluentd Intro for OpenShift Commons Briefing

Logging Pipeline

Page 17: Fluentd Intro for OpenShift Commons Briefing

How Fluentd Simplifies Logging Pipeline

Page 18: Fluentd Intro for OpenShift Commons Briefing

How Fluentd Simplifies Unified Logging Layer

Page 19: Fluentd Intro for OpenShift Commons Briefing

About Fluentd

● More than 600 plugins available

● Pluggable Architecture

● Built-in Reliability

● Full integration with Docker and Kubernetes

● Written in Ruby + C

Page 20: Fluentd Intro for OpenShift Commons Briefing

Fluentd Plugin Ecosystem

Page 21: Fluentd Intro for OpenShift Commons Briefing

Fluentd Modular Architecture

Page 22: Fluentd Intro for OpenShift Commons Briefing

Fluentd Structured Logging

Page 23: Fluentd Intro for OpenShift Commons Briefing

Fluentd at Scale

Page 24: Fluentd Intro for OpenShift Commons Briefing

Kubernetes & Fluentd

Page 25: Fluentd Intro for OpenShift Commons Briefing

Fluentd Deployment: DaemonSet

Page 26: Fluentd Intro for OpenShift Commons Briefing

Kubernetes: Fluentd Log Collection

Page 27: Fluentd Intro for OpenShift Commons Briefing

Fluentd: Enrich Logs with Kubernetes Metadata

Page 28: Fluentd Intro for OpenShift Commons Briefing

Storing the Logs

Page 29: Fluentd Intro for OpenShift Commons Briefing

Example: Logs from the Container

Page 30: Fluentd Intro for OpenShift Commons Briefing

Logs Stored by Fluentd

Page 31: Fluentd Intro for OpenShift Commons Briefing

Fluentd: Error Handling

Page 32: Fluentd Intro for OpenShift Commons Briefing

Fluentd: Retrying

Page 33: Fluentd Intro for OpenShift Commons Briefing

Fluentd: Kubernetes DaemonSet

Page 34: Fluentd Intro for OpenShift Commons Briefing

Fluentd Real WorldUse Cases

Page 35: Fluentd Intro for OpenShift Commons Briefing
Page 36: Fluentd Intro for OpenShift Commons Briefing

Extending the Fluentd Ecosystem

Page 37: Fluentd Intro for OpenShift Commons Briefing

Fluentd Modes

● Log Forwarder

● Log Aggregator

Page 38: Fluentd Intro for OpenShift Commons Briefing

Log Aggregator = (Forwarder + Buffering Capabilities)

Page 39: Fluentd Intro for OpenShift Commons Briefing

Edge Nodes / Forward to Aggregators

App

Node 1

DB

App DB

Page 40: Fluentd Intro for OpenShift Commons Briefing

Edge Nodes & Costs

Page 41: Fluentd Intro for OpenShift Commons Briefing

Edge Nodes & Costs

● Fluentd requires ~40MB as minimum

● Deploying a few hundred could be expensive

● Can we make Forward cheaper ?

Page 42: Fluentd Intro for OpenShift Commons Briefing

Forwarder & Aggregator

Log Forwarder Log Aggregator

Page 43: Fluentd Intro for OpenShift Commons Briefing
Page 44: Fluentd Intro for OpenShift Commons Briefing

About Fluent Bit

● Written in C

● Pluggable Architecture

● Built-in Reliability

● Event Driven - Async I/O

Page 45: Fluentd Intro for OpenShift Commons Briefing

Why Fluent Bit as a Forwarder

● Features

○ Input, Filter and Output Plugins

○ Built-in parsing support

○ Minimum memory required 450KB

Page 46: Fluentd Intro for OpenShift Commons Briefing

Edge Nodes / Forward to Aggregators

Page 47: Fluentd Intro for OpenShift Commons Briefing

Cheap Forwarding

Page 48: Fluentd Intro for OpenShift Commons Briefing

Cloud Native Features

● Backpressure

Page 49: Fluentd Intro for OpenShift Commons Briefing

Cloud Native Features

● Backpressure

Page 50: Fluentd Intro for OpenShift Commons Briefing

Cloud Native Features

● Backpressure

Page 51: Fluentd Intro for OpenShift Commons Briefing

Cloud Native Features

● Backpressure

Page 52: Fluentd Intro for OpenShift Commons Briefing

Cloud Native Features

● Backpressure Solved

Page 53: Fluentd Intro for OpenShift Commons Briefing

Cloud Native Features

● Backpressure Handling

● Security

● Kubernetes Metadata Filter

● Timestamps w/Nanoseconds (upcoming v0.12)

Page 54: Fluentd Intro for OpenShift Commons Briefing

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 55: Fluentd Intro for OpenShift Commons Briefing

Fluent Bit Kubernetes DaemonSet

Github Repository

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

Docker Hub Image

● fluent/fluent-bit-kubernetes-daemonset

Page 56: Fluentd Intro for OpenShift Commons Briefing

Fluent Bit

Project information

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

Contact / Community

● Slack http://slack.fluentd.org

Page 57: Fluentd Intro for OpenShift Commons Briefing
Page 58: Fluentd Intro for OpenShift Commons Briefing
Page 59: Fluentd Intro for OpenShift Commons Briefing

Questions?

Anurag Gupta - Product Manager Fluentd Enterprise - [email protected] Eduardo Silvia - Open Source Engineer - [email protected]

Interested in Fluentd Enterprise?

https://www.treasuredata.com/fluentd-enterprise/

Resources for Fluentd Open Source

http://www.fluentd.org

Community

http://slack.fluentd.org