Socket
Socket
Sign inDemoInstall

serverless-plugin-cloudwatch

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-plugin-cloudwatch

Generate CloudWatch Dashboard including widgets with configured metrics


Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

serverless-plugin-cloudwatch

Serverless plugin for setting up AWS CloudWatch dashboards with widgets (only from type 'metric') for configured metrics.

v0.1.0: it's still in development, not ready to use right now :)

Installation

Install via npm in the root of your Serverless service:

npm install serverless-plugin-cloudwatch

Add the plugin to the plugins array of your Serverless service in serverless.yml:

plugins:
  - serverless-plugin-cloudwatch

Usage

There will be only one dashboard per deployment stage. A dashboard is a customizable home page in the CloudWatch console that you can use to monitor your AWS resources in a single view. That's why there will be only one dashboard per deployment.

Following AWS Services are currently supported:

  • AWS Lambda

(AWS S3, AWS ApiGateway and AWS DynamoDB follows soon)

Configuration of the dashboard

The plugin can be configured by adding a property called dashboard to the custom properties of the Serverless service.

This is the minimum required configuration:

dashboard:
  lambda:
    enabled: true

Default configuration It will be used, if you only include the minimum required configuration. The default configuration looks like this:

dashboard:
  lambda:
    widgets:
      - name: 'Sum of Invocations'
        metrics: 
          - name: 'Invocations'
            stat: 'Sum'
      - name: 'Sum of Errors',
        metrics: 
          - name: 'Erorrs'
            stat: 'Sum'
    enabled: true

With the default configuration the following widgets will be added to the cloudwatch dashboard:

  • one widget with the title 'Sum of Invocations' and one metric 'Invocations'.
  • one widget with the title 'Sum of Errors' and one metric 'Errors' The metrics in a widget will be shown for each of your lambda functions (if lambda dashboards are enabled globally).

You can configure by your own:

  • the number of widgets by adding a widget to the array
  • the title (name) of the widget
  • which metrics (name) should be included in each widget
  • which statistic (stat) should be used for each metric

To gain maximum control over which functions to be included, you can disable lambda dashboards globally,

dashboard:
  lambda:
    enabled: false

and enable it only for specific functions, by setting the dashboard flag for those functions to true:

functions:
    myFunction:
      handler: some_handler
      dashboard: true

License

This software is released under the MIT license. See the license file for more details.

Keywords

FAQs

Package last updated on 03 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc