serverless-log-metric-filter

A Serverless Plugin to add metric filters to Cloudwatch Logs

Stats

StarsIssuesVersionUpdatedCreatedSize
serverless-log-metric-filter
000.0.0-alpha7 months ago7 months agoMinified + gzip package size for serverless-log-metric-filter in KB

Readme

Serverless-Log-Metric-Filter

npm package Build Status Downloads Issues Semantic Release

Installation

  • with NPM

    npm install --save-dev serverless-log-metric-filter
    
  • with Yarn

    yarn add --dev serverless-log-metric-filter
    
  • Then update serverless.yml file

    plugins:
    - serverless-log-metric-filter
    
  • Alternatively, install with the Serverless plugin command (Serverless Framework 1.22 or higher):

    sls plugin install -n serverless-log-metric-filter
    

Usage

  • To use fallback values, in your serverless.yml file

    custom:
    logMetricFilter:
      enabled: true
    
  • To add custom values, in your serverless.yml file

    custom:
    logMetricFilter:
      enabled: true
      filterPattern: Task timed out after
      metricName: TimeOut
      metricNameSpace: Lambda
      metricValue: 1
    
  • To disable for specific functions, in your serverless.yml file

    functions:
    exampleFunction:
      logMetricFilter: false
    

License

Copyright (c) 2021 Salem Qemlas. See the included LICENSE for rights and limitations under the terms of the MIT license.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.