Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×

Logging for Containers

Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Nächste SlideShare
Containers and Logging
Containers and Logging
Wird geladen in …3
×

Hier ansehen

1 von 62 Anzeige
Anzeige

Weitere Verwandte Inhalte

Diashows für Sie (20)

Ähnlich wie Logging for Containers (20)

Anzeige

Aktuellste (20)

Logging for Containers

  1. 1. Logging for Containers Eduardo Silva @edsiper
  2. 2. Logging
  3. 3. Logging ● Monitoring ● Troubleshooting ● Statistics It matters
  4. 4. ● Operating System ● Applications Unit ● Services Logging Scenarios Distribution Channels
  5. 5. Containers
  6. 6. Containers Everything is about Isolation
  7. 7. ● File System ● Standard I/O interfaces (stdout / stderr) ● Over Network Containers & Log Handlers Distribution Channels
  8. 8. ● Json-file ● Syslog ● Journald ● Fluentd ● ... Docker Implement drivers for different formats and distribution channels: Docker Logging Drivers Output / Destinations
  9. 9. Structured Logs
  10. 10. ● Often based in Key-Value pairs ● Two minimum keys: time and message Structured logging makes data processing easier Structured Logs Distribution Channels
  11. 11. ● JSON: readable format for structured data ● MessagePack: Binary serialization (json-like) Structured logging makes data processing easier Structured Logs Common Formats
  12. 12. Original Log Message This is a test message Structured Log Message { "container_id":"bfdd5b9...", "container_name":"/infallible_mayer", "source":"stdout", "log": "This is a test message" } Structured Logs Docker log example
  13. 13. Microservices
  14. 14. Monolithic ● A service produces all data about users access Microservices ● Many services produce data about users access ● Log needs to be collected from many services. Microservices
  15. 15. ● How to deal with different input formats ? ● Parse plain text is really expensive. ● Not all containers have permanent storage. ● Where to write the logs ? Microservices Logging Challenges
  16. 16. Distributed Logging
  17. 17. Distributed Logging Architecture
  18. 18. Collector ● Retrieve raw logs: file system / network. ● Parse log content. Aggregator ● Get data from multiple sources. ● Convert incoming data into Streams. Destination ● Retrieve data streams from Aggregator. ● Store formatted logs (records). Distributed Logging Workflow
  19. 19. ● Network Traffic ● CPU Load: parsing and formatting is expensive ● High Availability / Redundant aggregators Scaling Logging Items to consider
  20. 20. Aggregation Patterns
  21. 21. w/o source aggregation with source aggregation Source Aggregation Patterns
  22. 22. Pros ● Simple Configuration Cons ● Fixed Aggregator endpoint address ● Many network connections ● High load on Aggregator Aggregation Patterns Without Source Aggregation
  23. 23. Pros ● Less connections ● Lower load in aggregator ● Less config in Containers Cons ● Need more resources (1 aggregate container per host. Aggregation Patterns With Source Aggregation
  24. 24. w/o destination aggregation With destination aggregation Destination Aggregation Patterns
  25. 25. Pros ● Less Nodes ● Simpler configuration Cons ● Storage side changes affects collector side ● Worse performance: many small write requests on storage Aggregation Patterns Without Destination Aggregation
  26. 26. Pros ● Collector side configuration is free from storage side changes. ● Better performance with fine tune on destination side aggregator. Cons ● More Nodes. ● More complex configuration. Aggregation Patterns With Destination Aggregation
  27. 27. ● High Performance ● Built-in Reliability ● Structured Logs ● Pluggable Architecture ● More than 300 plugins! (input/filtering/output) Open Source Data/Log Collector
  28. 28. Architecture / Workflow
  29. 29. ● Docker Interoperability Native Docker logging driver to use Fluentd ● Kubernetes Fluentd as main aggregator (notes) ● OpenShift Fluentd as main aggregator Full Collector/Aggregator for Containers
  30. 30. Docker use case
  31. 31. Docker use case
  32. 32. Kubernetes use case
  33. 33. Fluentd in the Real World
  34. 34. Microsoft use case
  35. 35. We collect 1.8M events per second !
  36. 36. It’s a proud member of:
  37. 37. NEWS!
  38. 38. Fluentd is joining CNCF!
  39. 39. Let’s back to Logging
  40. 40. ● Written in C ● High Performance ● Pluggable Architecture ● Built-in CPU / Memory metrics / Network TLS support ● Event-Driven ● Fluentd Compatible! Fluent Bit Lightweight log aggregator
  41. 41. Fluent Bit Architecture
  42. 42. Messages Forwarding Performance 500K messages per second! (1 CPU core)
  43. 43. Architecture
  44. 44. Library Mode
  45. 45. Library Mode
  46. 46. Library Mode
  47. 47. Library Mode
  48. 48. Library Mode
  49. 49. Library Mode
  50. 50. Library Mode
  51. 51. Library Mode
  52. 52. Library Mode
  53. 53. Library Mode
  54. 54. Library Mode
  55. 55. ● Write plugins in Golang! ● Functional and upcoming for v0.10 release. ● Do you want to contribute ? Fluent Bit - Announcement Golang Support!
  56. 56. Fluent Bit - Announcement Golang Support!
  57. 57. ● Write Go plugins! ● Built-in HTTP Monitoring ● Variables ● Filtering Fluent Bit Roadmap v0.10
  58. 58. Eduardo Silva @edsiper eduardo@treasure-data.com http://fluentd.org http://fluentbit.io Thanks! Logging and Open Source matters!

×