1.2.3 • Published 8 months ago

serverless-plugin-metric v1.2.3

Weekly downloads
263
License
ISC
Repository
github
Last release
8 months ago

Serverless Plugin Metric

A serverless plugin to automatically create AWS:Logs:MetricFilter resources.

Requirements

  • Node: >= 4.6.1
  • Serverless: >= 1.24.1 (older versions not tested)

Installation

NPM:

npm install serverless-plugin-metric --save-dev

Add the plugin to serverless.yml

plugins:
  - serverless-plugin-metric

setup metrics:

custom:
  metrics: # Array<MetricOption>
    - name: foo
      pattern: "{ $.statusCode != 200 }"

Info: In order to display the metric on CloudWatch it is necessary to receive data.

Metric option type-definitions:

/** 
 * @typedef {object} MetricOption
 * @property {string} name              The name of the metric
 * @property {string} pattern           Filter patter doc (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html)
 * @property {string[]} [functions]     Default: ALL
 * @property {string} [namespace]       Override dynamic generated namespace (default: '<serviceName>/<stageName>')
 * @property {string} [value]           The value to apply to each occurence. (default: 1)
 */
1.2.3

8 months ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago