Skip to content

Instantly share code, notes, and snippets.

View harshitj2005's full-sized avatar

Harshit jain harshitj2005

  • Nagarro Software Pvt. Ltd
  • Pennsylvania
View GitHub Profile
@harshitj2005
harshitj2005 / cloud-watch-metrics-loadbalancer.md
Last active February 3, 2020 06:40
Lambda function to fetch classic, application and network Load balancer metrics from cloud watch and send them on ElasticSearch. Using elasticsearch and kibana we can visualise the metric graphs easily

Problem statement

Sometime we want to visalualise all our graph (including metrics and other business data) under single dashboard. Now AWS provides metrics for it's elastic load balancers but we can visualise them only on AWS console.

Solution Description

This function will fetch metrics from cloud watch for mentioned load balancers or all of the available load balancers in a specified region and put them on elastic search. From elastic search we can easily visualise them on various dashboard (for ex: kibana, redash, etc)

Steps to run this application on lambda

  1. create a folder in your system and save index.js and package.json in the same.
  2. Run npm i inside that folder from terminal