SlideShare a Scribd company logo
1 of 81
Nate Slater
Senior Manager, Solutions
Architecture, AWS
Amazon CloudWatch Logs and AWS Lambda
A Match Made in Heaven
DEV 301
March 30, 2017
What to Expect from the Session
Look at industry trends
impacting monitoring
Learn about CloudWatch
and CloudWatch Logs
Understand several key
monitoring use cases
See CloudWatch and
Lambda in action
Centralize
Centralize logs from
Elastic Load Balancing
(ELB) using S3 bucket
triggers
Customize
Customize alarms from
CloudWatch to fit your
specific needs
Analyze
Build an on-demand,
scalable Elasticsearch
cluster to solve a specific
problem or to do analysis
What to Expect: Scenario Preview
Recognize This?
Day in life!
The story you about to hear is true (mostly)…Only the names
have been changed to protect the innocent…
A customer writes a high severity ticket – your Application,
ImportantApp, is down
John, the on-call developer, is paged through the ticketing
system
None of your alarms fired
Blissful Ignorance
John engages and starts to scan service dashboards
He does see intermittent availability impact, but doesn’t
know how to assess impact to customers or where to begin
troubleshooting
He decides to escalate to a manager on-call
Confusion
More customer tickets are pouring in
An escalation manager, Jane, joins the event and starts to
assess the situation and impact
John and Jane’s CTO happens to notice the problem.
Sends Jane an IM – “Jane, what’s going on with
ImportantApp?”
Stress
Jane and John recall a recent issue where certain
customers started to issue “expensive” operations
John starts log diving on their production hosts
John identifies a suspect customer. Jane cuts a ticket and
John prepares a configuration change to block the
customer
False Hope
The other team engages and indicates they didn’t change
anything
Jane and John also confirm this when the availability
impact persists after deploying the configuration change
Out of ideas, John suggests to fail over to the standby – “It
can’t hurt…”
Desperation
After the failover, ImportantApp recovers (Yay!)
Our root cause deep dive finds that a new JDBC version
introduced a memory leak leading to Java heap exhaustion
We fix the leak, add new alarms on memory usage, and
tune our service alarms
Enlightenment
Can we do better than that?
Day in the Life - Reflection
• We have missing alarms and some of the alarms we
have are not actionable
• We do not always have the right logs and interacting
with them can be tedious
• Our dashboards do not tell us enough about customer
impact or behavior changes
Monitoring is really (really) hard!
Trends in Monitoring
Trend: Complexity Increasing
• Distributed micro-services based applications
• Applications are written in different languages and
frameworks
• Workloads are increasingly running on transient
resources such as containers and serverless compute
• Specialization in persistence tier
• Small changes are continuously built, tested, and
deployed
• As the scale and design of applications are changing
rapidly, so are the infrastructure needs
• Applications are global and customer behavior is
unpredictable
• Increased role of automation
Trend: Applications are More Dynamic
• Increased role of applications in business outcomes
(Revenue, Cost, SLA)
• Rapidly evolving applications are required to gain
competitive advantage
• Increased expectations from customers
Trend: More Business Impact
• Monitoring is no
longer standalone.
It is one aspect of
management and
increasingly integrated
into the lifecycle of
application
Trend: Integrated Management
CloudWatch
See React Diagnose Resolve
Use AWS generated metrics,
logs, and events over time to
understand the behavior of
your system
Publish custom metrics,
logs, and events for your
application specific
telemetry
See React Diagnose Resolve
Trigger automatic
notifications based on
your own rules and
metric thresholds
See React Diagnose Resolve
Inspect, navigate, zoom, and
correlate across time to
investigate issues
Jump to your logs directly
from your metrics to perform
searches or generate
additional metrics from log
data
See React Diagnose Resolve
Easily and automatically
correct issues via common
actions that you control
Define your own custom
actions based on Lambda
functions for more fine-grained
control
See React Diagnose Resolve
• Metrics Price Drop
• More metrics, logs, events from AWS
services: CloudTrail,
Elastic Beanstalk, SES
• Simple navigation from Metrics to
your Logs
• Upgraded metric retention from 2
weeks to up to 15 months
Recent Improvements
• Support for arbitrary metric percentiles
• collectd output plugin to simplify metric
collection
• Improvements in Dashboards (new
widgets, dark theme, Y axis limits)
• Improved Logs console experience
Recent Improvements (continued)
Not Just About What’s Inside CloudWatch
• Monitoring is hard (very hard)
• Every enterprise, team and situation has unique needs
• We have a rich partner ecosystem
• We give you the tools and flexibility to integrate with
other AWS services
Flexible
Egress
Comprehensive
Ingress
EC2
CloudTrail
ECS
Lambda
Amazon ES
S3
Lambda
CLOUDWATCH LOGS
Centralize
Search
Monitor
Stream
Retain
Secure
A log service for arbitrary scale,
availability, durability and security
Kinesis
Custom
Serverless Compute: AWS Lambda
COMPUTE
SERVICE
EVENT
DRIVEN
Run arbitrary
code without
managing
servers
Code only runs
when it needs to
run
Centralize
Centralize logs from
Elastic Load Balancing
(ELB) using S3 bucket
triggers
Customize
Customize alarms from
CloudWatch to fit your
specific needs
Analyze
Build an on-demand,
scalable Elasticsearch
cluster to solve a specific
problem or to do analysis
Problem Statements
• Log data is scattered on instances and S3 buckets
• It would be better if it were centralized in CloudWatch Logs
for searching and filtering
• Today CloudWatch provides an agent for instance logs,
what about S3 delivered logs?
Flow of Events
LambdaS3ELB CloudWatch
Logs
ELB logs
archived in S3
S3 Object Create
Event Notification
to Lambda
Lambda reads the
ELB log from S3
and publishes to
CloudWatch Logs
Apache Servers
ELB & Lambda
Configured
Lambda Triggered
ELB logs in
CloudWatch
Provision three EC2 instances running Apache
Apache Servers
ELB & Lambda
Configured
Lambda Triggered
ELB logs in
CloudWatch
Create an ELB
Apache Servers
ELB & Lambda
Configured
Lambda Triggered
ELB logs in
CloudWatch
Create a TargetGroup with the three Apache servers
Apache Servers
ELB & Lambda
Configured
Lambda Triggered
ELB logs in
CloudWatch
Enable ELB log delivery to S3
Apache Servers
ELB & Lambda
Configured
Lambda Triggered
ELB logs in
CloudWatch
Configure the Lambda function to trigger on S3 object create
Apache Servers
ELB & Lambda
Configured
Lambda Triggered
ELB logs in
CloudWatch
Read the ELB logs from the S3 bucket by invoking S3 GetObject API
Apache Servers
ELB & Lambda
Configured
Lambda Triggered
ELB logs in
CloudWatch
Post the logs into CloudWatch Logs by invoking putLogEvents SDK API
Apache Servers
ELB & Lambda
Configured
Lambda Triggered
ELB logs in
CloudWatch
ELB serving traffic
Apache Servers
ELB & Lambda
Configured
Lambda Triggered
ELB logs in
CloudWatch
Verify that ELB logs are delivered to S3
Apache Servers
ELB & Lambda
Configured
Lambda Triggered
ELB logs in
CloudWatch
Access the ELB logs from CloudWatch Logs
Apache Servers
ELB & Lambda
Configured
Lambda Triggered
ELB logs in
CloudWatch
Search for the HTTP GET calls in the last 24 hours
Apache Servers
ELB& Lambda
Configured
Lambda Triggered
ELB logs in
CloudWatch
Create a filter pattern to extract requests with a latency of more than 1 ms
Define a metric filter on the log group
Apache Servers
ELB& Lambda
Configured
Lambda Triggered
ELB logs in
CloudWatch
Apache Servers
ELB& Lambda
Configured
Lambda Triggered
ELB logs in
CloudWatch
View the metric graph for ELB latency
HighLatencyCount
Key takeaways
1. S3 delivered log data from any source can be
centralized into CloudWatch Logs using Lambda
2. You can search and extract metrics from those logs in
near real time
Centralize
Centralize logs from
Elastic Load Balancing
(ELB) using S3 bucket
triggers
Customize
Customize alarms from
CloudWatch to fit your
specific needs
Analyze
Build an on-demand,
scalable Elasticsearch
cluster to solve a specific
problem or to do analysis
Problem Statements
• When you get an alarm you want enough information to
decide whether it needs immediate attention or not
• You want to customize the alarm text and format to your
operational needs
Flow of Events
Error in Logs
generates an Alarm to
an SNS topic
SNS topic
triggers an Event
Notification to
Lambda
Lambda gets the
filtered logs, calls
SES to email with
those logs
SESLambdaCloudWatch
Logs
CloudWatch
Alarms
Metric Filter
Defined
Alarm & Lambda
Configured
Lambda Triggered SES sends Email
Provision an EC2 instance with Tomcat running on it
Hello World
CloudWatch agent sends EC2 instance logs to CloudWatch Logs
Metric Filter
Defined
Alarm & Lambda
Configured
Lambda Triggered SES sends Email
Define a filter pattern to extract Unauthorized access attempts
Metric Filter
Defined
Alarm & Lambda
Configured
Lambda Triggered SES sends Email
Define a metric filter on the log group
Metric Filter
Defined
Alarm & Lambda
Configured
Lambda Triggered SES sends Email
Define an alarm with a specific threshold for that metric
Metric Filter
Defined
Alarm & Lambda
Configured
Lambda Triggered SES sends Email
test
Configure the Lambda function to trigger on SNS topic message
Metric Filter
Defined
Alarm & Lambda
Configured
Lambda Triggered SES sends Email
Hello World
Metric Filter
Defined
Alarm & Lambda
Configured
Lambda Triggered SES sends Email
Get the metric filter information by invoking the describeMetricFilters SDK API
Metric Filter
Defined
Alarm & Lambda
Configured
Lambda Triggered SES sends Email
Get the relevant log data by invoking the filterLogEvents SDK API
Metric Filter
Defined
Alarm & Lambda
Configured
Lambda Triggered SES sends Email
SES sends an email with the relevant log data
Unauthorized Access attempts on the Tomcat server
Metric Filter
Defined
Alarm & Lambda
Configured
Lambda Triggered SES sends Email
Alarm generated due to Unauthorized Access attempts
Metric Filter
Defined
Alarm & Lambda
Configured
Lambda Triggered SES sends Email
test
test
test
test
View email with the relevant Log data about the Alarm
Metric Filter
Defined
Alarm & Lambda
Configured
Lambda Triggered SES sends Email
test
test
Hell
o
test
Key takeaways
• Alarms can be customized to add specific details about
the issue
• When you see a spike on a metric, you can also get the
logs describing the issue triggering the alarm
• The Lambda function can be extended to add your
specific information to the alarm
Centralize
Centralize logs from
Elastic Load Balancing
(ELB) using S3 bucket
triggers
Customize
Customize alarms from
CloudWatch to fit your
specific needs
Analyze
Build an on-demand,
scalable Elasticsearch
cluster to solve a specific
problem or to do analysis
Problem Statements
• You want to do log analysis using Elasticsearch but don’t
want to leave the cluster running all the time
• You want to send data to Elasticsearch, but don’t want to
manage ongoing operations
• Build an on demand Elasticsearch cluster from historical
data
Flow of Events
LambdaS3
CloudWatch
Logs
CloudWatch Logs in
a specific timeframe
exported to S3
S3 Object Create
Event Notification
to Lambda
Lambda transforms
and sends only filtered
logs to Elasticsearch
Amazon
ES
Logs exported to
S3
Lambda
Configured
Logs to
Elasticsearch
Visuals in Kibana
Configure flow logging for your VPC
Logs exported to
S3
Lambda
Configured
Logs to
Elasticsearch
Visuals in Kibana
View the VPC Flow logs in CloudWatch Logs
Logs exported to
S3
Lambda
Configured
Logs to
Elasticsearch
Visuals in Kibana
Create an Amazon ES domain
Logs exported to
S3
Lambda
Configured
Logs to
Elasticsearch
Visuals in Kibana
Read the VPC Flow Logs from the S3 bucket by invoking GetObject API
Logs exported to
S3
Lambda
Configured
Logs to
Elasticsearch
Visuals in Kibana
Transform the VPC Flow logs into a JSON document for Elasticsearch
Logs exported to
S3
Lambda
Configured
Logs to
Elasticsearch
Visuals in Kibana
Ingest the logs into Elasticsearch by putting to its HTTP endpoint
Logs exported to
S3
Lambda
Configured
Logs to
Elasticsearch
Visuals in Kibana
Export the VPC Flow logs to S3
Logs exported to
S3
Lambda
Configured
Logs to
Elasticsearch
Visuals in Kibana
VPC Flow logs exported to S3
Logs exported to
S3
Lambda
Configured
Logs to
Elasticsearch
Visuals in Kibana
View the VPC Flow logs in Kibana
Logs exported to
S3
Lambda
Configured
Logs to
Elasticsearch
Visuals in Kibana
View Different Dashboards in Kibana
Logs exported to
S3
Lambda
Configured
Logs to
Elasticsearch
Visuals in Kibana
View Different Dashboards in Kibana
Key takeaways
• Send historical data within a timeframe to Elasticsearch on
demand
• This reduces cost, burden of scalability, and operations
time
• Troubleshooting gets easier because you have only
limited and relevant data
Recap
• Monitoring is more important than ever, but still too hard
• CloudWatch is working to make monitoring easier
• CloudWatch Logs and Lambda are powerful tools to
tailor your monitoring for your business needs
Useful Links
• CloudWatch Overview - https://aws.amazon.com/cloudwatch/
• Documentation - https://aws.amazon.com/documentation/cloudwatch/
• CloudWatch Blog - https://aws.amazon.com/blogs/aws/category/amazon-
cloud-watch/
• Lambda functions used in the demo scenarios
Centralize - https://github.com/awslabs/cloudwatch-logs-centralize-logs
Customize - https://github.com/awslabs/cloudwatch-logs-customize-alarms
Analyze - https://github.com/awslabs/cloudwatch-logs-analyze-data
Remember to complete
your evaluations!
Thank you!

More Related Content

What's hot

다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
Amazon Web Services Korea
 

What's hot (20)

Modern Enterprise 여정의 핵심 – SAP on AWS 마이그레이션-장현, AWS SAP Architect / 강병수, AWS...
Modern Enterprise 여정의 핵심 – SAP on AWS 마이그레이션-장현, AWS SAP Architect / 강병수, AWS...Modern Enterprise 여정의 핵심 – SAP on AWS 마이그레이션-장현, AWS SAP Architect / 강병수, AWS...
Modern Enterprise 여정의 핵심 – SAP on AWS 마이그레이션-장현, AWS SAP Architect / 강병수, AWS...
 
스플렁크를 이용한 AWS운영 인텔리전스 확보:: Splunk 최승돈 :: AWS Summit Seoul 2016
스플렁크를 이용한 AWS운영 인텔리전스 확보:: Splunk 최승돈 :: AWS Summit Seoul 2016스플렁크를 이용한 AWS운영 인텔리전스 확보:: Splunk 최승돈 :: AWS Summit Seoul 2016
스플렁크를 이용한 AWS운영 인텔리전스 확보:: Splunk 최승돈 :: AWS Summit Seoul 2016
 
How Redlock Automates Security on AWS
How Redlock Automates Security on AWSHow Redlock Automates Security on AWS
How Redlock Automates Security on AWS
 
Azure Migrate
Azure MigrateAzure Migrate
Azure Migrate
 
Amazon simple storage service (amazon s3)
Amazon simple storage service (amazon s3)Amazon simple storage service (amazon s3)
Amazon simple storage service (amazon s3)
 
개인화 및 추천 기능의 맞춤형 AI 서비스 혁명: Amazon Personalize - 남궁영환 솔루션즈 아키텍트, AWS / 강성문 솔루...
개인화 및 추천 기능의 맞춤형 AI 서비스 혁명: Amazon Personalize - 남궁영환 솔루션즈 아키텍트, AWS / 강성문 솔루...개인화 및 추천 기능의 맞춤형 AI 서비스 혁명: Amazon Personalize - 남궁영환 솔루션즈 아키텍트, AWS / 강성문 솔루...
개인화 및 추천 기능의 맞춤형 AI 서비스 혁명: Amazon Personalize - 남궁영환 솔루션즈 아키텍트, AWS / 강성문 솔루...
 
Cloudwatch: Monitoring your Services with Metrics and Alarms
Cloudwatch: Monitoring your Services with Metrics and AlarmsCloudwatch: Monitoring your Services with Metrics and Alarms
Cloudwatch: Monitoring your Services with Metrics and Alarms
 
AWS Storage services
AWS Storage servicesAWS Storage services
AWS Storage services
 
금융권 고객을 위한 클라우드 보안 및 규정 준수 가이드 - 이대근 시큐리티 어슈어런스 매니저, AWS :: AWS Summit Seoul ...
금융권 고객을 위한 클라우드 보안 및 규정 준수 가이드 - 이대근 시큐리티 어슈어런스 매니저, AWS :: AWS Summit Seoul ...금융권 고객을 위한 클라우드 보안 및 규정 준수 가이드 - 이대근 시큐리티 어슈어런스 매니저, AWS :: AWS Summit Seoul ...
금융권 고객을 위한 클라우드 보안 및 규정 준수 가이드 - 이대근 시큐리티 어슈어런스 매니저, AWS :: AWS Summit Seoul ...
 
대용량 데이터베이스의 클라우드 네이티브 DB로 전환 시 확인해야 하는 체크 포인트-김지훈, AWS Database Specialist SA...
대용량 데이터베이스의 클라우드 네이티브 DB로 전환 시 확인해야 하는 체크 포인트-김지훈, AWS Database Specialist SA...대용량 데이터베이스의 클라우드 네이티브 DB로 전환 시 확인해야 하는 체크 포인트-김지훈, AWS Database Specialist SA...
대용량 데이터베이스의 클라우드 네이티브 DB로 전환 시 확인해야 하는 체크 포인트-김지훈, AWS Database Specialist SA...
 
Aws storage
Aws storageAws storage
Aws storage
 
Monitor Azure HDInsight with Azure Log Analytics
Monitor Azure HDInsight with Azure Log AnalyticsMonitor Azure HDInsight with Azure Log Analytics
Monitor Azure HDInsight with Azure Log Analytics
 
Aws platform overview
Aws platform overviewAws platform overview
Aws platform overview
 
Azure Compute, Networking and Storage Overview
Azure Compute, Networking and Storage OverviewAzure Compute, Networking and Storage Overview
Azure Compute, Networking and Storage Overview
 
Monitor All Your Things: Amazon CloudWatch in Action with BBC (DEV302) - AWS ...
Monitor All Your Things: Amazon CloudWatch in Action with BBC (DEV302) - AWS ...Monitor All Your Things: Amazon CloudWatch in Action with BBC (DEV302) - AWS ...
Monitor All Your Things: Amazon CloudWatch in Action with BBC (DEV302) - AWS ...
 
천만 사용자를 위한 AWS 아키텍처 보안 모범 사례 (윤석찬, 테크에반젤리스트)
천만 사용자를 위한 AWS 아키텍처 보안 모범 사례 (윤석찬, 테크에반젤리스트)천만 사용자를 위한 AWS 아키텍처 보안 모범 사례 (윤석찬, 테크에반젤리스트)
천만 사용자를 위한 AWS 아키텍처 보안 모범 사례 (윤석찬, 테크에반젤리스트)
 
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
다양한 솔루션으로 만들어가는 AWS 네트워크 보안::이경수::AWS Summit Seoul 2018
 
AWS Compute Evolved Week: High Performance Computing on AWS
AWS Compute Evolved Week: High Performance Computing on AWSAWS Compute Evolved Week: High Performance Computing on AWS
AWS Compute Evolved Week: High Performance Computing on AWS
 
AWS 101
AWS 101AWS 101
AWS 101
 
AWS for Backup and Recovery
AWS for Backup and RecoveryAWS for Backup and Recovery
AWS for Backup and Recovery
 

Viewers also liked

Viewers also liked (9)

Centralized logging
Centralized loggingCentralized logging
Centralized logging
 
Containers on AWS
Containers on AWSContainers on AWS
Containers on AWS
 
Voice of the Customer: Moving to a secure house in the cloud with cutting-edg...
Voice of the Customer: Moving to a secure house in the cloud with cutting-edg...Voice of the Customer: Moving to a secure house in the cloud with cutting-edg...
Voice of the Customer: Moving to a secure house in the cloud with cutting-edg...
 
AWS Security Enabiling Fintech Pace Security AWS Summit SG 2017
AWS Security Enabiling Fintech Pace Security AWS Summit SG 2017 AWS Security Enabiling Fintech Pace Security AWS Summit SG 2017
AWS Security Enabiling Fintech Pace Security AWS Summit SG 2017
 
Agility and Control from AWS [FutureStack16]
Agility and Control from AWS [FutureStack16]Agility and Control from AWS [FutureStack16]
Agility and Control from AWS [FutureStack16]
 
Increasing MTBLS with New Relic [FutureStack16 NYC]
Increasing MTBLS with New Relic [FutureStack16 NYC]Increasing MTBLS with New Relic [FutureStack16 NYC]
Increasing MTBLS with New Relic [FutureStack16 NYC]
 
AWS Monitoring & Logging
AWS Monitoring & LoggingAWS Monitoring & Logging
AWS Monitoring & Logging
 
AWS re:Invent 2016: Enterprise Fundamentals: Design Your Account and VPC Arch...
AWS re:Invent 2016: Enterprise Fundamentals: Design Your Account and VPC Arch...AWS re:Invent 2016: Enterprise Fundamentals: Design Your Account and VPC Arch...
AWS re:Invent 2016: Enterprise Fundamentals: Design Your Account and VPC Arch...
 
AWS re:Invent 2016: Enabling Enterprise Migrations: Creating an AWS Landing Z...
AWS re:Invent 2016: Enabling Enterprise Migrations: Creating an AWS Landing Z...AWS re:Invent 2016: Enabling Enterprise Migrations: Creating an AWS Landing Z...
AWS re:Invent 2016: Enabling Enterprise Migrations: Creating an AWS Landing Z...
 

Similar to Amazon CloudWatch Logs and AWS Lambda

devworkshop-10_28_1015-amazon-conference-presentation
devworkshop-10_28_1015-amazon-conference-presentationdevworkshop-10_28_1015-amazon-conference-presentation
devworkshop-10_28_1015-amazon-conference-presentation
Alex Wu
 

Similar to Amazon CloudWatch Logs and AWS Lambda (20)

Amazon CloudWatch Logs and AWS Lambda
Amazon CloudWatch Logs and AWS LambdaAmazon CloudWatch Logs and AWS Lambda
Amazon CloudWatch Logs and AWS Lambda
 
AWS re:Invent 2016: Amazon CloudWatch Logs and AWS Lambda: A Match Made in He...
AWS re:Invent 2016: Amazon CloudWatch Logs and AWS Lambda: A Match Made in He...AWS re:Invent 2016: Amazon CloudWatch Logs and AWS Lambda: A Match Made in He...
AWS re:Invent 2016: Amazon CloudWatch Logs and AWS Lambda: A Match Made in He...
 
AWS re:Invent 2016: Amazon CloudWatch Logs and AWS Lambda: A Match Made in He...
AWS re:Invent 2016: Amazon CloudWatch Logs and AWS Lambda: A Match Made in He...AWS re:Invent 2016: Amazon CloudWatch Logs and AWS Lambda: A Match Made in He...
AWS re:Invent 2016: Amazon CloudWatch Logs and AWS Lambda: A Match Made in He...
 
Amazon CloudWatch Logs and AWS Lambda: A Match Made in Heaven | AWS Public Se...
Amazon CloudWatch Logs and AWS Lambda: A Match Made in Heaven | AWS Public Se...Amazon CloudWatch Logs and AWS Lambda: A Match Made in Heaven | AWS Public Se...
Amazon CloudWatch Logs and AWS Lambda: A Match Made in Heaven | AWS Public Se...
 
Amazon CloudWatch Logs and AWS Lambda: A Match Made in Heaven
Amazon CloudWatch Logs and AWS Lambda: A Match Made in HeavenAmazon CloudWatch Logs and AWS Lambda: A Match Made in Heaven
Amazon CloudWatch Logs and AWS Lambda: A Match Made in Heaven
 
Amazon CloudWatch Logs and AWS Lambda: A Match Made in Heaven
Amazon CloudWatch Logs and AWS Lambda: A Match Made in HeavenAmazon CloudWatch Logs and AWS Lambda: A Match Made in Heaven
Amazon CloudWatch Logs and AWS Lambda: A Match Made in Heaven
 
AWS re:Invent 2016: Automated Governance of Your AWS Resources (DEV302)
AWS re:Invent 2016: Automated Governance of Your AWS Resources (DEV302)AWS re:Invent 2016: Automated Governance of Your AWS Resources (DEV302)
AWS re:Invent 2016: Automated Governance of Your AWS Resources (DEV302)
 
Easily Govern and Audit your AWS Resources
Easily Govern and Audit your AWS ResourcesEasily Govern and Audit your AWS Resources
Easily Govern and Audit your AWS Resources
 
Best Practices for SecOps on AWS
Best Practices for SecOps on AWSBest Practices for SecOps on AWS
Best Practices for SecOps on AWS
 
Automatisierte Kontrolle und Transparenz in der AWS Cloud – Autopilot für Com...
Automatisierte Kontrolle und Transparenz in der AWS Cloud – Autopilot für Com...Automatisierte Kontrolle und Transparenz in der AWS Cloud – Autopilot für Com...
Automatisierte Kontrolle und Transparenz in der AWS Cloud – Autopilot für Com...
 
DPD:AWS Developer Training
DPD:AWS Developer TrainingDPD:AWS Developer Training
DPD:AWS Developer Training
 
AWS Summit Auckland - Getting Started with AWS Lambda and the Serverless Cloud
AWS Summit Auckland - Getting Started with AWS Lambda and the Serverless CloudAWS Summit Auckland - Getting Started with AWS Lambda and the Serverless Cloud
AWS Summit Auckland - Getting Started with AWS Lambda and the Serverless Cloud
 
Automated Governance of Your AWS Resources
Automated Governance of Your AWS ResourcesAutomated Governance of Your AWS Resources
Automated Governance of Your AWS Resources
 
Best Practices for Managing Security Operations in AWS - March 2017 AWS Onlin...
Best Practices for Managing Security Operations in AWS - March 2017 AWS Onlin...Best Practices for Managing Security Operations in AWS - March 2017 AWS Onlin...
Best Practices for Managing Security Operations in AWS - March 2017 AWS Onlin...
 
Serverless Analytics and Monitoring For Your Cloud App
Serverless Analytics and Monitoring For Your Cloud AppServerless Analytics and Monitoring For Your Cloud App
Serverless Analytics and Monitoring For Your Cloud App
 
devworkshop-10_28_1015-amazon-conference-presentation
devworkshop-10_28_1015-amazon-conference-presentationdevworkshop-10_28_1015-amazon-conference-presentation
devworkshop-10_28_1015-amazon-conference-presentation
 
Automate Best Practices and Operational Health for your AWS Resources
Automate Best Practices and Operational Health for your AWS ResourcesAutomate Best Practices and Operational Health for your AWS Resources
Automate Best Practices and Operational Health for your AWS Resources
 
Using AWS CloudTrail and AWS Config to Enhance Governance and Compliance of A...
Using AWS CloudTrail and AWS Config to Enhance Governance and Compliance of A...Using AWS CloudTrail and AWS Config to Enhance Governance and Compliance of A...
Using AWS CloudTrail and AWS Config to Enhance Governance and Compliance of A...
 
Logging using ELK Stack for Microservices
Logging using ELK Stack for MicroservicesLogging using ELK Stack for Microservices
Logging using ELK Stack for Microservices
 
Automate Your Big Data Workflows (SVC201) | AWS re:Invent 2013
Automate Your Big Data Workflows (SVC201) | AWS re:Invent 2013Automate Your Big Data Workflows (SVC201) | AWS re:Invent 2013
Automate Your Big Data Workflows (SVC201) | AWS re:Invent 2013
 

More from Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Recently uploaded

Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
amilabibi1
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
raffaeleoman
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
Sheetaleventcompany
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
Kayode Fayemi
 

Recently uploaded (20)

Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
Causes of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCauses of poverty in France presentation.pptx
Causes of poverty in France presentation.pptx
 
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Bailey
 
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatment
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 

Amazon CloudWatch Logs and AWS Lambda

  • 1. Nate Slater Senior Manager, Solutions Architecture, AWS Amazon CloudWatch Logs and AWS Lambda A Match Made in Heaven DEV 301 March 30, 2017
  • 2. What to Expect from the Session Look at industry trends impacting monitoring Learn about CloudWatch and CloudWatch Logs Understand several key monitoring use cases See CloudWatch and Lambda in action
  • 3. Centralize Centralize logs from Elastic Load Balancing (ELB) using S3 bucket triggers Customize Customize alarms from CloudWatch to fit your specific needs Analyze Build an on-demand, scalable Elasticsearch cluster to solve a specific problem or to do analysis What to Expect: Scenario Preview
  • 5. Day in life! The story you about to hear is true (mostly)…Only the names have been changed to protect the innocent…
  • 6. A customer writes a high severity ticket – your Application, ImportantApp, is down John, the on-call developer, is paged through the ticketing system None of your alarms fired Blissful Ignorance
  • 7. John engages and starts to scan service dashboards He does see intermittent availability impact, but doesn’t know how to assess impact to customers or where to begin troubleshooting He decides to escalate to a manager on-call Confusion
  • 8. More customer tickets are pouring in An escalation manager, Jane, joins the event and starts to assess the situation and impact John and Jane’s CTO happens to notice the problem. Sends Jane an IM – “Jane, what’s going on with ImportantApp?” Stress
  • 9. Jane and John recall a recent issue where certain customers started to issue “expensive” operations John starts log diving on their production hosts John identifies a suspect customer. Jane cuts a ticket and John prepares a configuration change to block the customer False Hope
  • 10. The other team engages and indicates they didn’t change anything Jane and John also confirm this when the availability impact persists after deploying the configuration change Out of ideas, John suggests to fail over to the standby – “It can’t hurt…” Desperation
  • 11. After the failover, ImportantApp recovers (Yay!) Our root cause deep dive finds that a new JDBC version introduced a memory leak leading to Java heap exhaustion We fix the leak, add new alarms on memory usage, and tune our service alarms Enlightenment
  • 12. Can we do better than that?
  • 13. Day in the Life - Reflection • We have missing alarms and some of the alarms we have are not actionable • We do not always have the right logs and interacting with them can be tedious • Our dashboards do not tell us enough about customer impact or behavior changes Monitoring is really (really) hard!
  • 15. Trend: Complexity Increasing • Distributed micro-services based applications • Applications are written in different languages and frameworks • Workloads are increasingly running on transient resources such as containers and serverless compute • Specialization in persistence tier
  • 16. • Small changes are continuously built, tested, and deployed • As the scale and design of applications are changing rapidly, so are the infrastructure needs • Applications are global and customer behavior is unpredictable • Increased role of automation Trend: Applications are More Dynamic
  • 17. • Increased role of applications in business outcomes (Revenue, Cost, SLA) • Rapidly evolving applications are required to gain competitive advantage • Increased expectations from customers Trend: More Business Impact
  • 18. • Monitoring is no longer standalone. It is one aspect of management and increasingly integrated into the lifecycle of application Trend: Integrated Management
  • 20. Use AWS generated metrics, logs, and events over time to understand the behavior of your system Publish custom metrics, logs, and events for your application specific telemetry See React Diagnose Resolve
  • 21. Trigger automatic notifications based on your own rules and metric thresholds See React Diagnose Resolve
  • 22. Inspect, navigate, zoom, and correlate across time to investigate issues Jump to your logs directly from your metrics to perform searches or generate additional metrics from log data See React Diagnose Resolve
  • 23. Easily and automatically correct issues via common actions that you control Define your own custom actions based on Lambda functions for more fine-grained control See React Diagnose Resolve
  • 24. • Metrics Price Drop • More metrics, logs, events from AWS services: CloudTrail, Elastic Beanstalk, SES • Simple navigation from Metrics to your Logs • Upgraded metric retention from 2 weeks to up to 15 months Recent Improvements
  • 25. • Support for arbitrary metric percentiles • collectd output plugin to simplify metric collection • Improvements in Dashboards (new widgets, dark theme, Y axis limits) • Improved Logs console experience Recent Improvements (continued)
  • 26. Not Just About What’s Inside CloudWatch • Monitoring is hard (very hard) • Every enterprise, team and situation has unique needs • We have a rich partner ecosystem • We give you the tools and flexibility to integrate with other AWS services
  • 28. Serverless Compute: AWS Lambda COMPUTE SERVICE EVENT DRIVEN Run arbitrary code without managing servers Code only runs when it needs to run
  • 29. Centralize Centralize logs from Elastic Load Balancing (ELB) using S3 bucket triggers Customize Customize alarms from CloudWatch to fit your specific needs Analyze Build an on-demand, scalable Elasticsearch cluster to solve a specific problem or to do analysis
  • 30. Problem Statements • Log data is scattered on instances and S3 buckets • It would be better if it were centralized in CloudWatch Logs for searching and filtering • Today CloudWatch provides an agent for instance logs, what about S3 delivered logs?
  • 31. Flow of Events LambdaS3ELB CloudWatch Logs ELB logs archived in S3 S3 Object Create Event Notification to Lambda Lambda reads the ELB log from S3 and publishes to CloudWatch Logs
  • 32. Apache Servers ELB & Lambda Configured Lambda Triggered ELB logs in CloudWatch Provision three EC2 instances running Apache
  • 33. Apache Servers ELB & Lambda Configured Lambda Triggered ELB logs in CloudWatch Create an ELB
  • 34. Apache Servers ELB & Lambda Configured Lambda Triggered ELB logs in CloudWatch Create a TargetGroup with the three Apache servers
  • 35. Apache Servers ELB & Lambda Configured Lambda Triggered ELB logs in CloudWatch Enable ELB log delivery to S3
  • 36. Apache Servers ELB & Lambda Configured Lambda Triggered ELB logs in CloudWatch Configure the Lambda function to trigger on S3 object create
  • 37. Apache Servers ELB & Lambda Configured Lambda Triggered ELB logs in CloudWatch Read the ELB logs from the S3 bucket by invoking S3 GetObject API
  • 38. Apache Servers ELB & Lambda Configured Lambda Triggered ELB logs in CloudWatch Post the logs into CloudWatch Logs by invoking putLogEvents SDK API
  • 39. Apache Servers ELB & Lambda Configured Lambda Triggered ELB logs in CloudWatch ELB serving traffic
  • 40. Apache Servers ELB & Lambda Configured Lambda Triggered ELB logs in CloudWatch Verify that ELB logs are delivered to S3
  • 41. Apache Servers ELB & Lambda Configured Lambda Triggered ELB logs in CloudWatch Access the ELB logs from CloudWatch Logs
  • 42. Apache Servers ELB & Lambda Configured Lambda Triggered ELB logs in CloudWatch Search for the HTTP GET calls in the last 24 hours
  • 43. Apache Servers ELB& Lambda Configured Lambda Triggered ELB logs in CloudWatch Create a filter pattern to extract requests with a latency of more than 1 ms
  • 44. Define a metric filter on the log group Apache Servers ELB& Lambda Configured Lambda Triggered ELB logs in CloudWatch
  • 45. Apache Servers ELB& Lambda Configured Lambda Triggered ELB logs in CloudWatch View the metric graph for ELB latency HighLatencyCount
  • 46. Key takeaways 1. S3 delivered log data from any source can be centralized into CloudWatch Logs using Lambda 2. You can search and extract metrics from those logs in near real time
  • 47. Centralize Centralize logs from Elastic Load Balancing (ELB) using S3 bucket triggers Customize Customize alarms from CloudWatch to fit your specific needs Analyze Build an on-demand, scalable Elasticsearch cluster to solve a specific problem or to do analysis
  • 48. Problem Statements • When you get an alarm you want enough information to decide whether it needs immediate attention or not • You want to customize the alarm text and format to your operational needs
  • 49. Flow of Events Error in Logs generates an Alarm to an SNS topic SNS topic triggers an Event Notification to Lambda Lambda gets the filtered logs, calls SES to email with those logs SESLambdaCloudWatch Logs CloudWatch Alarms
  • 50. Metric Filter Defined Alarm & Lambda Configured Lambda Triggered SES sends Email Provision an EC2 instance with Tomcat running on it Hello World
  • 51. CloudWatch agent sends EC2 instance logs to CloudWatch Logs Metric Filter Defined Alarm & Lambda Configured Lambda Triggered SES sends Email
  • 52. Define a filter pattern to extract Unauthorized access attempts Metric Filter Defined Alarm & Lambda Configured Lambda Triggered SES sends Email
  • 53. Define a metric filter on the log group Metric Filter Defined Alarm & Lambda Configured Lambda Triggered SES sends Email
  • 54. Define an alarm with a specific threshold for that metric Metric Filter Defined Alarm & Lambda Configured Lambda Triggered SES sends Email test
  • 55. Configure the Lambda function to trigger on SNS topic message Metric Filter Defined Alarm & Lambda Configured Lambda Triggered SES sends Email Hello World
  • 56. Metric Filter Defined Alarm & Lambda Configured Lambda Triggered SES sends Email Get the metric filter information by invoking the describeMetricFilters SDK API
  • 57. Metric Filter Defined Alarm & Lambda Configured Lambda Triggered SES sends Email Get the relevant log data by invoking the filterLogEvents SDK API
  • 58. Metric Filter Defined Alarm & Lambda Configured Lambda Triggered SES sends Email SES sends an email with the relevant log data
  • 59. Unauthorized Access attempts on the Tomcat server Metric Filter Defined Alarm & Lambda Configured Lambda Triggered SES sends Email
  • 60. Alarm generated due to Unauthorized Access attempts Metric Filter Defined Alarm & Lambda Configured Lambda Triggered SES sends Email test test test test
  • 61. View email with the relevant Log data about the Alarm Metric Filter Defined Alarm & Lambda Configured Lambda Triggered SES sends Email test test Hell o test
  • 62. Key takeaways • Alarms can be customized to add specific details about the issue • When you see a spike on a metric, you can also get the logs describing the issue triggering the alarm • The Lambda function can be extended to add your specific information to the alarm
  • 63. Centralize Centralize logs from Elastic Load Balancing (ELB) using S3 bucket triggers Customize Customize alarms from CloudWatch to fit your specific needs Analyze Build an on-demand, scalable Elasticsearch cluster to solve a specific problem or to do analysis
  • 64. Problem Statements • You want to do log analysis using Elasticsearch but don’t want to leave the cluster running all the time • You want to send data to Elasticsearch, but don’t want to manage ongoing operations • Build an on demand Elasticsearch cluster from historical data
  • 65. Flow of Events LambdaS3 CloudWatch Logs CloudWatch Logs in a specific timeframe exported to S3 S3 Object Create Event Notification to Lambda Lambda transforms and sends only filtered logs to Elasticsearch Amazon ES
  • 66. Logs exported to S3 Lambda Configured Logs to Elasticsearch Visuals in Kibana Configure flow logging for your VPC
  • 67. Logs exported to S3 Lambda Configured Logs to Elasticsearch Visuals in Kibana View the VPC Flow logs in CloudWatch Logs
  • 68. Logs exported to S3 Lambda Configured Logs to Elasticsearch Visuals in Kibana Create an Amazon ES domain
  • 69. Logs exported to S3 Lambda Configured Logs to Elasticsearch Visuals in Kibana Read the VPC Flow Logs from the S3 bucket by invoking GetObject API
  • 70. Logs exported to S3 Lambda Configured Logs to Elasticsearch Visuals in Kibana Transform the VPC Flow logs into a JSON document for Elasticsearch
  • 71. Logs exported to S3 Lambda Configured Logs to Elasticsearch Visuals in Kibana Ingest the logs into Elasticsearch by putting to its HTTP endpoint
  • 72. Logs exported to S3 Lambda Configured Logs to Elasticsearch Visuals in Kibana Export the VPC Flow logs to S3
  • 73. Logs exported to S3 Lambda Configured Logs to Elasticsearch Visuals in Kibana VPC Flow logs exported to S3
  • 74. Logs exported to S3 Lambda Configured Logs to Elasticsearch Visuals in Kibana View the VPC Flow logs in Kibana
  • 75. Logs exported to S3 Lambda Configured Logs to Elasticsearch Visuals in Kibana View Different Dashboards in Kibana
  • 76. Logs exported to S3 Lambda Configured Logs to Elasticsearch Visuals in Kibana View Different Dashboards in Kibana
  • 77. Key takeaways • Send historical data within a timeframe to Elasticsearch on demand • This reduces cost, burden of scalability, and operations time • Troubleshooting gets easier because you have only limited and relevant data
  • 78. Recap • Monitoring is more important than ever, but still too hard • CloudWatch is working to make monitoring easier • CloudWatch Logs and Lambda are powerful tools to tailor your monitoring for your business needs
  • 79. Useful Links • CloudWatch Overview - https://aws.amazon.com/cloudwatch/ • Documentation - https://aws.amazon.com/documentation/cloudwatch/ • CloudWatch Blog - https://aws.amazon.com/blogs/aws/category/amazon- cloud-watch/ • Lambda functions used in the demo scenarios Centralize - https://github.com/awslabs/cloudwatch-logs-centralize-logs Customize - https://github.com/awslabs/cloudwatch-logs-customize-alarms Analyze - https://github.com/awslabs/cloudwatch-logs-analyze-data

Editor's Notes

  1. 6 And that, essentially, is the origin story for AWS Lambda. Lambda is a compute service that allows you to run code without any of the responsibilities we just talked about – just upload the code, and Lambda takes care of spinning up the required compute power to execute the code in scalable, highly available manner. Lambda is also an event driven service, in that your code only executes when needed in response to an event, such as an incoming request, or an update to data.
  2. On-demand Elastic Search for historical data - Save Money, Scale, Operations, Rapidly solving problems Customize alarms and make them some
  3. On-demand Elastic Search for historical data - Save Money, Scale, Operations, Rapidly solving problems Customize alarms and make them some
  4. On-demand Elastic Search for historical data - Save Money, Scale, Operations, Rapidly solving problems Customize alarms and make them some