Slide 1

Slide 1 text

S U M M I T B ERL I N

Slide 2

Slide 2 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Observability for Modern Applications Christoph Kassen Sr. Solutions Architect

Slide 3

Slide 3 text

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 4

Slide 4 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T What are modern applications? Built on containers and serverless Microservices architecture and distributed

Slide 5

Slide 5 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Service Service Service Service Service Service Service Service Service Service Service Service

Slide 6

Slide 6 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Ruby RDS Aurora Elastic search Dynamo DB Rust Go Node.is Java Node.is Python

Slide 7

Slide 7 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Emerging best practices • Componentize applications using microservices • Standardize operations by modeling apps and infrastructure as code • Improve application performance with full stack observability • Enable experimentation by creating small autonomous teams • Update applications & infrastructure quickly by automating CI/CD • Ensure trust by automating security & compliance

Slide 8

Slide 8 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T AWS building blocks for microservices Storage & Database Logging & Monitoring Application Integration Developer Tools Networking & API Proxy Compute Amazon MSK

Slide 9

Slide 9 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T How do we monitor and control all of these microservices?

Slide 10

Slide 10 text

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 11

Slide 11 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Monitoring Methodologies Resources Microservices USE method by Brendan Gregg For every resource, check: Utilization Saturation Errors RED method by Tom Wilkie For every service, monitor request: Rate Errors Duration

Slide 12

Slide 12 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Amazon CloudWatch Use AWS generated metrics, logs, and events Publish custom metrics, logs, and events for app specific telemetry Trigger automatic actions and notifications based on rules and metric thresholds Define your own custom actions based on AWS Lambda functions

Slide 13

Slide 13 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Prometheus & Grafana Prometheus Aggregation and metrics storage Community Integrations Open source Grafana Visualize metrics Dashboards

Slide 14

Slide 14 text

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 15

Slide 15 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Log ingestion Collect Fargate/ECS Built-in log collectors EKS Bring your own collector Lambda Automatically collected Aggregate Cloudwatch Logs Insights Elasticsearch Splunk

Slide 16

Slide 16 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T CloudWatch Log Insights

Slide 17

Slide 17 text

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 18

Slide 18 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T AWS X-Ray is built for modern applications Analyze and debug issues quickly End-to-end view of individual services Identify customer impact Support for Serverless

Slide 19

Slide 19 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T X-Ray concepts user request response Trace Segment Sub-segment Frontend API Amazon DynamoDB table Amazon Simple Queue Service (Amazon SQS)

Slide 20

Slide 20 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T App & X-Ray SDK Pod X-Ray daemon UDP X-Ray API HTTPS HTTPS X-Ray console App & X-Ray SDK X-Ray daemon UDP DevOps Team HTTPS X-Ray workflow Pod Pod Pod

Slide 21

Slide 21 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Instrumentation with X-Ray SDK’s Enables you to get started quickly without having to manually instrument your application code to log metadata about requests Available for Java, .NET, Python, Go, Ruby, and Node.js Adds filters to automatically capture metadata for calls to: AWS services using the AWS SDK Non-AWS services over HTTP and HTTPS Databases (MySQL, PostgreSQL, and Amazon DynamoDB) Queues (Amazon SQS)

Slide 22

Slide 22 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T App instrumentation (Node.js) //Add aws-xray-sdk package to package.json const AWSXRay = require('aws-xray-sdk’); // Configure plugins AWSXRay.config([AWSXRay.plugins.EC2Plugin,AWSXRay.plugins.ECSPlugin]); const xrayExpress = require('aws-xray-sdk-express’); // Load middleware app.use(xrayExpress.openSegment('Frontend’)); app.get('/', function(req, res) … // Import or add Express.js routes app.use(xrayExpress.closeSegment());

Slide 23

Slide 23 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T App instrumentation (Python) from aws_xray_sdk.core import xray_recorder, patch_all from aws_xray_sdk.ext.flask.middleware import XRayMiddleware plugins = ('EC2Plugin', 'ECSPlugin') # Plugins # Configure recorder xray_recorder.configure(service='recommenderservice',plugins=plugins) # Add Xray middleware to Flask app XRayMiddleware(app, xray_recorder) # Patch clients, SDK‘s such as boto3, requests, ... patch_all()

Slide 24

Slide 24 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T What it should look like

Slide 25

Slide 25 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T How do we monitor and control all of these microservices?

Slide 26

Slide 26 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T What is needed Consistent communications management Complete visibility Failure isolation and protection Fine-grained deployment controls

Slide 27

Slide 27 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Implementation options Microservice Container In-process (SDK) Out-of-process (sidecar proxy) Option 1 Option 2 Microservice Container Proxy

Slide 28

Slide 28 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Why service mesh proxy Reduce work required by developers Follow best practices Use any language or platform Simplify visibility, troubleshooting, and deployments

Slide 29

Slide 29 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Observability & traffic control Easily export logs, metrics, and traces Client side traffic policies—circuit breaking, retries Routes for deployments Works across clusters and container services Amazon ECS Amazon EKS Kubernetes on EC2 AWS Fargate (coming soon!) AWS built and run No control plane to manage Ease of operations High scale AWS App Mesh

Slide 30

Slide 30 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T OSS project Wide community support, numerous integrations Stable and production-proven “Graduated Project” in Cloud Native Computing Foundation Started at Lyft in 2016 App Mesh uses Envoy proxy

Slide 31

Slide 31 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Application observability + others Faster troubleshooting due to consistent data across services Existing tools or dashboards with a lot more metrics, logs and traces Distinguish between service and network issues

Slide 32

Slide 32 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Client side traffic management Traffic Shaping Service discovery Retries Timeouts Circuit breaks Health checks Routing Controls Protocols support Header based Cookie based Path based Host based

Slide 33

Slide 33 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Fine-grained deployment control B1 B2 20% 80% A

Slide 34

Slide 34 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Fine-grained deployment control B1 B2 3% 97% A

Slide 35

Slide 35 text

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 36

Slide 36 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Representing your app in App Mesh Elastic Load Balancing Microservices App Mesh Mesh – [myapp] Virtual Node A Service Discovery Listener Backends Virtual Node B Service Discovery Listener Backends

Slide 37

Slide 37 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Virtual Node Virtual Node Service Discovery Backends Listeners Virtual Node Logical representation of runtime services Backends Set of destinations that this node will communicate with (hostnames) Service Discovery Describes how its callers and locate this node (DNS hostname or AWS Cloud Map* namespace, serviced, and selectors) Listeners Policies to handle incoming traffic Ed: port, Health check*, Circuit breaker*, Retries*

Slide 38

Slide 38 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Elastic Load Balancing Microservices App Mesh Mesh – [myapp] Virtual Node A Virtual Node B Virtual Router Routes Create route

Slide 39

Slide 39 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Virtual routes Destination’s virtual router and route Virtual router: B HTTP routes Match Prefix: / Action: Targets B Route B Virtual node destination + weight Route Name: B1 Match Action: Route Name: B2 Other Protocol routes

Slide 40

Slide 40 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Mesh – [myapp] Virtual Node A Service Discovery Backend Listener Virtual router Domains action: match: / B B’ Service B Service B’ Virtual Node B’ Service Discovery Listener Backends Virtual Node B Service Discovery Listener Backends

Slide 41

Slide 41 text

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 42

Slide 42 text

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 43

Slide 43 text

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Gain insights across resources and applications by enabling observability

Slide 44

Slide 44 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Key takeaways Serverless and containers are building blocks of modern applications AWS X-Ray is powerful tool to visualize and troubleshoot issues Observability and control with AWS App Mesh Take a user-centric approach to monitor modern applications

Slide 45

Slide 45 text

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 46

Slide 46 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. S U M M I T Getting started Compute Blog Application tracing on Kubernetes with AWS X-Ray EKS and X-Ray Examples https://github.com/aws-samples/reinvent2018-dev303-code App Mesh https://aws.amazon.com/app-mesh Examples & Roadmap https://github.com/awslabs/aws-app-mesh-examples

Slide 47

Slide 47 text

Thank you! S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Christoph Kassen @christoph_k Special thanks to the AWS App Mesh and Container teams

Slide 48

Slide 48 text

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.