@middy/cloudwatch-metrics
Advanced tools
Comparing version 2.0.1 to 2.1.0
{ | ||
"name": "@middy/cloudwatch-metrics", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Embedded CloudWatch metrics middleware for the middy framework", | ||
@@ -55,5 +55,5 @@ "type": "commonjs", | ||
"devDependencies": { | ||
"@middy/core": "^2.0.1" | ||
"@middy/core": "^2.1.0" | ||
}, | ||
"gitHead": "b0eca01cad1b16439cb4dc21dab92b7221f52515" | ||
"gitHead": "966ce6cb0ebba61fc7d60d9baa37395a9eaf4a51" | ||
} |
@@ -13,4 +13,4 @@ # Middy Cloudwatch metrics middleware | ||
<p> | ||
<a href="http://badge.fury.io/js/%40middy%2Fsecrets-manager"> | ||
<img src="https://badge.fury.io/js/%40middy%2Fsecrets-manager.svg" alt="npm version" style="max-width:100%;"> | ||
<a href="http://badge.fury.io/js/%40middy%2Fcloudwatch-metrics"> | ||
<img src="https://badge.fury.io/js/%40middy%2Fcloudwatch-metrics.svg" alt="npm version" style="max-width:100%;"> | ||
</a> | ||
@@ -43,3 +43,3 @@ <a href="https://snyk.io/test/github/middyjs/middy"> | ||
```bash | ||
npm install --save @middy/metrics | ||
npm install --save @middy/cloudwatch-metrics | ||
``` | ||
@@ -64,11 +64,10 @@ | ||
const middy = require('@middy/core') | ||
const metrics = require('@middy/metrics') | ||
const cloudwatchMetrics = require('@middy/cloudwatch-metrics') | ||
const handler = middy((event, context, cb) => { | ||
const handler = middy((event, context) => { | ||
context.metrics.putMetric("ProcessingLatency", 100, "Milliseconds"); | ||
context.metrics.setProperty("RequestId", "422b1569-16f6-4a03-b8f0-fe3fd9b100f8") | ||
cb(null, {}) | ||
}) | ||
handler.use(metrics({ | ||
handler.use(cloudwatchMetrics({ | ||
namspace: "myAppliction", | ||
@@ -75,0 +74,0 @@ dimensions: [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7575
92