Share
Embed
Observability for Modern Applications
Creating modern applications requires a combination of many different services and technologies. Using containers and Kubernetes teams can simplify deployment, operations, and scalability. The coordination of services and communication between them become more complex. Teams now need to handle the challenges of operating and monitoring distributed applications. This talk covers operational best practices for running modern applications using Amazon EKS. See how monitoring and tracing enable teams to quickly understand problem areas in your applications and determine customer impact. Learn how AWS AppMesh enables teams to dynamically adjust traffic routing in your applications.
Christoph Kassen
February 27, 2019
Transcript
48 slides
-
© 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 -
S U M M I T © 2019, Amazon Web
Services, Inc. or its affiliates. All rights reserved. -
© 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 -
© 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 -
© 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 -
© 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 -
© 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 -
© 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? -
S U M M I T © 2019, Amazon Web
Services, Inc. or its affiliates. All rights reserved. -
© 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 -
© 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 -
© 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 -
S U M M I T © 2019, Amazon Web
Services, Inc. or its affiliates. All rights reserved. -
© 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 -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T CloudWatch Log Insights -
S U M M I T © 2019, Amazon Web
Services, Inc. or its affiliates. All rights reserved. -
© 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 -
© 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) -
© 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 -
© 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) -
© 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()); -
© 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() -
© 2019, Amazon Web Services, Inc. or its affiliates. All
rights reserved. S U M M I T What it should look like -
© 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? -
© 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 -
© 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 -
© 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 -
© 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 -
© 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 -
© 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 -
© 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 -
© 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 -
© 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 -
S U M M I T © 2019, Amazon Web
Services, Inc. or its affiliates. All rights reserved. -
© 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 -
© 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* -
© 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 -
© 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 -
© 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 -
S U M M I T © 2019, Amazon Web
Services, Inc. or its affiliates. All rights reserved. -
S U M M I T © 2019, Amazon Web
Services, Inc. or its affiliates. All rights reserved. -
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 -
© 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 -
S U M M I T © 2019, Amazon Web
Services, Inc. or its affiliates. All rights reserved. -
© 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 -
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 -
S U M M I T © 2019, Amazon Web
Services, Inc. or its affiliates. All rights reserved.