Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@middy/cloudwatch-metrics

Package Overview
Dependencies
Maintainers
3
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@middy/cloudwatch-metrics - npm Package Compare versions

Comparing version 2.5.5 to 2.5.6

42

index.js

@@ -1,38 +0,32 @@

"use strict";
const awsEmbeddedMetrics = require('aws-embedded-metrics')
const awsEmbeddedMetrics = require('aws-embedded-metrics');
const cloudwatchMetricsMiddleware = (opts = {}) => {
const defaults = {};
const options = { ...defaults,
...opts
};
const defaults = {}
const options = { ...defaults, ...opts }
const cloudwatchMetricsBefore = request => {
const metrics = awsEmbeddedMetrics.createMetricsLogger(); // If not set, defaults to aws-embedded-metrics
const cloudwatchMetricsBefore = (request) => {
const metrics = awsEmbeddedMetrics.createMetricsLogger()
// If not set, defaults to aws-embedded-metrics
if (options.namespace) {
metrics.setNamespace(options.namespace);
} // If not set, defaults to ServiceName, ServiceType and LogGroupName
metrics.setNamespace(options.namespace)
}
// If not set, defaults to ServiceName, ServiceType and LogGroupName
if (options.dimensions) {
metrics.setDimensions(...options.dimensions);
metrics.setDimensions(...options.dimensions)
}
Object.assign(request.context, { metrics })
}
Object.assign(request.context, {
metrics
});
};
const cloudwatchMetricsAfter = async (request) => {
await request.context.metrics.flush()
}
const cloudwatchMetricsAfter = async request => {
await request.context.metrics.flush();
};
return {
before: cloudwatchMetricsBefore,
after: cloudwatchMetricsAfter
};
};
}
}
module.exports = cloudwatchMetricsMiddleware;
module.exports = cloudwatchMetricsMiddleware
{
"name": "@middy/cloudwatch-metrics",
"version": "2.5.5",
"version": "2.5.6",
"description": "Embedded CloudWatch metrics middleware for the middy framework",

@@ -55,5 +55,5 @@ "type": "commonjs",

"devDependencies": {
"@middy/core": "^2.5.5"
"@middy/core": "^2.5.6"
},
"gitHead": "b84840ec8afd289f6decfd0d645be4899051792d"
"gitHead": "0c789f55b4adf691f977b0d9904d1a805bb3bb2b"
}
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