Logging in the age of

Similar documents
Here comes the. Cloud. But is your architecture ready for

Architecting for the.

Immutable Infrastructure

Immutable Infrastructure

Building a Data-Friendly Platform for a Data- Driven Future

Java Architectures A New Hope. Eberhard Wolff

[Docker] Containerization

Azure Certification BootCamp for Exam (Developer)

NGF0502 AWS Student Slides

Principal Solutions Architect. Architecting in the Cloud

Introduction to reactive programming. Jonas Chapuis, Ph.D.

AWS Lambda. 1.1 What is AWS Lambda?

Immutable Server Generation. The New App Deployment. AXEL

Reactive Microservices Architecture on AWS

Design Patterns for the Cloud. MCSN - N. Tonellotto - Distributed Enabling Platforms 68

OpenShift on Public & Private Clouds: AWS, Azure, Google, OpenStack

Using DC/OS for Continuous Delivery

Developing Microsoft Azure Solutions (70-532) Syllabus

@joerg_schad Nightmares of a Container Orchestration System

Container 2.0. Container: check! But what about persistent data, big data or fast data?!

Introduction to cloud computing

Enroll Now to Take online Course Contact: Demo video By Chandra sir

PCS Cloud Solutions. Create highly-available, infinitely-scalable applications and APIs

Serverless The Future of the Cloud?!

Top five Docker performance tips

Amazon Web Services (AWS) Training Course Content

DevOps Tooling from AWS

WHITE PAPER NGINX An Open Source Platform of Choice for Enterprise Website Architectures

Microservices Lessons Learned From a Startup Perspective

DISTRIBUTED SYSTEMS [COMP9243] Lecture 8a: Cloud Computing WHAT IS CLOUD COMPUTING? 2. Slide 3. Slide 1. Why is it called Cloud?

Securing Microservices Containerized Security in AWS

How to setup Orchestrator to manage thousands of MySQL servers. Simon J Mudd 3 rd October 2017

AWS Solution Architecture Patterns

Advanced Continuous Delivery Strategies for Containerized Applications Using DC/OS

AWS Reference Architecture - CloudGen Firewall Auto Scaling Cluster

Distributed CI: Scaling Jenkins on Mesos and Marathon. Roger Ignazio Puppet Labs, Inc. MesosCon 2015 Seattle, WA

DevOps on AWS Deep Dive on Continuous Delivery and the AWS Developer Tools

KEMP360 Central. 1 Introduction. KEMP360 Central. Feature Description

State of the Dolphin Developing new Apps in MySQL 8

AWS Lambda: Event-driven Code in the Cloud

Deploying and Operating Cloud Native.NET apps

Lassoing the Clouds: Best Practices on AWS. Brian DeShong May 26, 2017

Beyond 1001 Dedicated Data Service Instances

Application of Virtualization Technologies & CernVM. Benedikt Hegner CERN

Sync Services. Server Planning Guide. On-Premises

Designing MQ deployments for the cloud generation

How we built a highly scalable Machine Learning platform using Apache Mesos

ticrypt DEPLOYMENT OVERVIEW AND TIMELINE Information about hardware, deployment, and on-boarding

Big Data Integration Patterns. Michael Häusler Jun 12, 2017

Technical Comparison Sheet: ez Platform Cloud vs Other Hosting Approaches

Zero to Millions: Building an XLSP for Gears of War 2

#AWSSummit. Démarrer sur AWS. L élasticité et les outils de gestions

Amazon Web Services Training. Training Topics:

DELIVERING WITH MICROSERVICES HOW TO ITERATE TOWARDS SOPHISTICATION

Apigee Edge Developer Training

Critical Analysis and last hour guide for RHCSA/RHCE Enterprise 7

Using AWS to Build a Large Scale Dockerized Microservices Architecture. Dr. Oliver Wahlen moovel Group GmbH Frankfurt, 30.

LINUX, WINDOWS(MCSE),

Better, Faster, Stronger web apps with Amazon Web Services. Senior Technology Evangelist, Amazon Web Services

Sync Services. Server Planning Guide. On-Premises

A Journey to DynamoDB

Exam : Implementing Microsoft Azure Infrastructure Solutions

Lassoing the Clouds: Best Practices on AWS. Brian DeShong May 26, 2017

Continuous Delivery. from Zero to Hero. AXEL axelfontaine.com Entrepreneur - Public Speaker - Continuous Delivery Expert

SAS Viya 3.4 Administration: Logging

Scaling Up Performance Benchmarking

Real Life Web Development. Joseph Paul Cohen

Implementing Microservices Tracing with Spring Cloud and Zipkin

Use Case: Scalable applications

Aspirin as a Service: Using the Cloud to Cure Security Headaches

Kubernetes The Path to Cloud Native

What s New in MySQL and MongoDB Ecosystem Year 2017

WHITEPAPER AMAZON ELB: Your Master Key to a Secure, Cost-Efficient and Scalable Cloud.

Wrapp. Powered by AWS EC2 Container Service. Jude D Souza Solutions Wrapp Phone:

CogniFit Technical Security Details

FIREFLY ARCHITECTURE: CO-BROWSING AT SCALE FOR THE ENTERPRISE

The Cloud's Cutting Edge: ArcGIS for Server Use Cases for Amazon Web Services. David Cordes David McGuire Jim Herries Sridhar Karra

Managing Performance in Liferay DXP: An Overview of Liferay Connected Services

CLOUD ECONOMICS: HOW TO QUANTIFY THE BENEFITS OF MOVING TO THE CLOUD

How can you implement this through a script that a scheduling daemon runs daily on the application servers?

Training on Amazon AWS Cloud Computing. Course Content

FIVE REASONS YOU SHOULD RUN CONTAINERS ON BARE METAL, NOT VMS

The Software Development Process at Amazon

Oracle Solaris 11: No-Compromise Virtualization

Lassoing the Clouds: Best Practices on AWS. Brian DeShong May 26, 2017

Services: Monitoring and Logging. 9/16/2018 IST346: Info Tech Management & Administration 1

Document Sub Title. Yotpo. Technical Overview 07/18/ Yotpo

PARTLY CLOUDY DESIGN & DEVELOPMENT OF A HYBRID CLOUD SYSTEM

PCI DSS Compliance. White Paper Parallels Remote Application Server

Evaluation Guide for ASP.NET Web CMS and Experience Platforms

Container in Production : Openshift 구축사례로 이해하는 PaaS. Jongjin Lim Specialist Solution Architect, AppDev

Przyspiesz tworzenie aplikacji przy pomocy Openshift Container Platform. Jarosław Stakuń Senior Solution Architect/Red Hat CEE

JANUARY 28, 2014, SAN JOSE, CA. Microsoft Lead Partner Architect OS Vendors: What NVM Means to Them

GOING FULLY SERVERLESS

Migrating and living on RDS/Aurora. life after Datacenters

Documentation. This PDF was generated for your convenience. For the latest documentation, always see

High Availability Distributed (Micro-)services. Clemens Vasters Microsoft

BUILDING A SCALABLE MOBILE GAME BACKEND IN ELIXIR. Petri Kero CTO / Ministry of Games

DEFINING SECURITY FOR TODAY S CLOUD ENVIRONMENTS. Security Without Compromise

Amazon Web Services (AWS) Solutions Architect Intermediate Level Course Content

Transcription:

Logging in the age of and the Cloud Microservices @axelfontaine

POLL: what type of infrastructure are you running on? On Premise Colocation Root Server Cloud

The (good) old days of logging

ssh me@myserver LOG file tail -f server.log

Looks great!

@axelfontaine Thanks! boxfuse.com

ssh me@myserver LOG file tail -f server.log

Times have changed

The new reality Cloud Microservices

Cloud

moving to the cloud

lift & shift (= the naïve approach)

Congratulations! You now have: lift & shift (= the naïve approach) Lots of (too much?) trust in your cloud provider + legal trouble due to data privacy laws A more expense Hetzner/OVH Potential data loss when auto-scaling

Fundamental changes 1. Security 2. Cost-driven 3. Auto-scaling

1. Security

understanding the cloud

regions

availability zones <<IMAGE GERMANY + two small clouds with racks>>

building blocks http://en.wikipedia.org/wiki/lego#/media/file:lego_color_bricks.jpg

building blocks Storage Compute Network Security

The hard Truth about Security 1. Always breakable with infinite time & resources 2. Must make it more complicated/expensive to break than it s worth (use defense in depth!) 3. Has a usability cost 4. Almost always about the data

the 3 states of data Data at Rest Data in Use Data in Motion

Trusting your neighbors is good. But it s even better to put a good lock on the door. Werner Vogels CTO of a large online book shop http://en.wikipedia.org/wiki/werner_vogels#/media/file:wernervogels_ddp.jpg

Data in Motion No excuse in 2017! 100% free and automated With Let s Encrypt and AWS Certificate Manager TLS / SSL

Client-side encryption Data in Use & at Rest

2. Cost-driven

Compute

Spare Capacity = Wasted Money (paying for something you don t use)

Scaling = Adjusting capacity in response to a metric exceeding a threshold

Scaling = Corrective action in response to an alarm

scaling metrics for different types of services sync => CPU load async => queue depth cron => time

scaling up in out down

3. Auto-scaling

Auto-Scaling = automated alarms + automated corrective actions (scaling in or out)

Load Balancer LOG file LOG file LOG file ssh me@myserver1 tail -f server.log ssh me@myserver2 tail -f server.log ssh me@myserver3 tail -f server.log Scale Out Scale In CPU Load

Load Balancer LOG file LOG file LOG file ssh me@myserver1 tail -f server.log ssh me@myserver2 tail -f server.log ssh me@myserver3 tail -f server.log Scale Out Scale In LOG file ssh me@myserver4 tail -f server.log CPU Load

Load Balancer LOG file LOG file LOG file ssh me@myserver1 tail -f server.log ssh me@myserver2 tail -f server.log ssh me@myserver3 tail -f server.log Scale Out Scale In LOG file ssh me@myserver4 tail -f server.log CPU Load

Load Balancer LOG file LOG file LOG file ssh me@myserver1 tail -f server.log ssh me@myserver2 tail -f server.log ssh me@myserver3 tail -f server.log Scale Out Scale In LOG file ssh me@myserver4 tail -f server.log CPU Load

LOG file ssh me@myserver1 tail -f server.log Load Balancer LOG file LOG file DATA LOSS ssh me@myserver3 tail -f server.log Scale Out Scale In LOG file ssh me@myserver4 tail -f server.log CPU Load

LOG file Load Balancer log server LOG file LOG file where logs can be aggregated stored and backuped indexed searched

Many options: Logstash (ELK) AWS CloudWatch Logs Loggly Papertrail log server where logs can be aggregated stored and backuped indexed searched

Microservices

POLL: what type of architecture does your software have? Integrated (Monolith) Distributed (Microservices)

Why are we logging? Postmortem analysis of user activity and programming errors Powerful debugging tool Should contain answers to important questions: What? Who? Where? When?

What? Who? Where? When?

What? Who? Where? When? Message, Code, Severity

What? Who? Where? When? Message, Code, Severity Account, User, Session, Request

What? Who? Where? When? Message, Code, Severity Account, User, Session, Request App, Module, Class

What? Who? Where? When? Message, Code, Severity Account, User, Session, Request App, Module, Class Timestamp, Hostname, PID, Thread How can all this information be captured? How can these questions be asked?

Capturing log info

Logging framework architecture Your Code Logger Appender A Appender B Storage A Storage B

Logging framework architecture Your Code Logger File Appender Log Server Appender Text File(s) Log Server

logger.info( my log message ); What? Who? Where? When? Message, Code, Severity Account, User, Session, Request App, Module, Class Timestamp, Hostname, PID, Thread

logger.info( my log message ); What? Who? Where? When? Message, Code, Severity Account, User, Session, Request App, Module, Class Timestamp, Hostname, PID, Thread

logger.info( my log message ); What? Who? Where? When? Message, Code, Severity Account, User, Session, Request App, Module, Class Timestamp, Hostname, PID, Thread

Mapped Diagnostic Context (Thread-local temporary key-value store) Your Code MDC Logger Appender A Appender B Storage A Storage B

MDC.put( account, company ABC ); MDC.put( user, user123 ); What? Who? Where? When? Message, Code, Severity Account, User, Session, Request App, Module, Class Timestamp, Hostname, PID, Thread

MDC.put( account, company ABC ); MDC.put( user, user123 ); logger.info( my log message ); What? Who? Where? When? Message, Code, Severity Account, User, Session, Request App, Module, Class Timestamp, Hostname, PID, Thread

MDC.put( account, company ABC ); MDC.put( user, user123 ); Populate when: a request enters the application a message is received from a queue an async or cron task starts And don t forget the clear when done! (Threadpools reuse threads!)

Querying the logs

grep?

Truncation! Compression! Single line messages! No MDC info!

Decoupling log storage from log representation

MDC Appender FORMAT Storage (formatted) Your Code Logger READ Log Viewer

Your Code MDC Logger Appender Storage (raw) READ & FORMAT Log Viewer

Structured logging

{ } "account": "axelfontaine", "image": "axelfontaine/xyz:543", "instance": "i-0d843d5af9b366a69", "level": "INFO", "logger": "com.myapp.task.taskservice", "message": "Successfully killed axelfontaine/demo in prod", "request": "crq-7r2cvpumkreuflmque3xb7jwcx", "session": "cli-crfm2ipabrfujd7ktdyvdvxabx", "thread": "Thread-18710", "timestamp": "2017-05-12T10:20:30.444"

Machine-readable logs

Machine-readable logs Machine-queryable logs What? Who? Where? When? Message, Code, Severity Account, User, Session, Request App, Module, Class Timestamp, Hostname, PID, Thread

AWS CloudWatch Logs

{ $.account = axelfontaine && $.request = crq-12345678 }

log server

Querying across systems

Propagating MDC A B C Create MDC (based on session) and assign unique request ID Copy MDC to HTTP(S) headers Read MDC HTTP(S) headers Copy MDC to HTTP(S) headers Read MDC HTTP(S) headers

Propagating MDC A B C Filter Decorator Filter Decorator Filter

Standardized keys

{ } "account": "axelfontaine", "image": "axelfontaine/xyz:543", "instance": "i-0d843d5af9b366a69", "level": "INFO", "logger": "com.myapp.task.taskservice", "message": "Successfully killed axelfontaine/demo in prod", "request": "crq-7r2cvpumkreuflmque3xb7jwcx", "session": "cli-crfm2ipabrfujd7ktdyvdvxabx", "thread": "Thread-18710", "timestamp": "2017-05-12T10:20:30.444"

Standardized values

{ } "account": "axelfontaine", "image": "axelfontaine/xyz:543", "instance": "i-0d843d5af9b366a69", "level": "INFO", "logger": "com.myapp.task.taskservice", "message": "Successfully killed axelfontaine/demo in prod", "request": "crq-7r2cvpumkreuflmque3xb7jwcx", "session": "cli-crfm2ipabrfujd7ktdyvdvxabx", "thread": "Thread-18710", "timestamp": "2017-05-12T10:20:30.444"

Summary Send your logs to a centralized service Ensure your logs are structured Use and propagate MDC Standardize keys and values Query your logs to answer the what, who, where, when questions

About Axel Fontaine Founder and CEO of Boxfuse Flyway creator Continuous Delivery & Immutable Infrastructure expert Java Champion, JavaOne RockStar @axelfontaine

Evolve your relational database schema reliably across all your instances Supports all popular RDBMS flywaydb.org Open-source (with commercial support available) Millions of users

Deploy JVM (Spring Boot, Dropwizard, Tomcat, TomEE,...), Node.js and Go apps effortlessly to AWS Immutable infrastructure with minimal images just 1% of size of regular OS (think Linux x64 kernel + your app) Zero downtime orchestration on AWS (atomic blue/green deployments) boxfuse.com First-class support for centralized, structure and standardized logging with AWS CloudWatch Logs

Thanks! @axelfontaine boxfuse.com flywaydb.org