
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@middy/cloudwatch-metrics
Advanced tools
Embedded CloudWatch metrics middleware for the middy framework
Metrics middleware for the middy framework, the stylish Node.js middleware engine for AWS Lambda
This middleware hydrates lambda's context.metrics
property with an instance of MetricLogger. This instance can be used to easily generate custom metrics from Lambda functions without requiring custom batching code, making blocking network requests or relying on 3rd party software.
Metrics collected with this logger are then available for querying within AWS CloudWatch Log Insights
You can explore all the MetricLogger APIs following aws-embedded-metrics documentation.
To install this middleware you can use NPM:
npm install --save @middy/cloudwatch-metrics
namespace
(string) (default aws-embedded-metrics
): Sets the CloudWatch namespace that extracted metrics should be published to.dimensions
(Record<String, String>[]): Defaults to
[
{"ServiceName": "myLambdaFunctionName"},
{"ServiceType": "AWS::Lambda::Function"},
{"LogGroupName": "logGroupNameUsedByMyLambda"},
]
Explicitly override all dimensions. This will remove the default dimensions. You can provide an empty array to record all metrics without dimensions.import middy from '@middy/core'
import cloudwatchMetrics from '@middy/cloudwatch-metrics'
const handler = middy((event, context) => {
context.metrics.putMetric("ProcessingLatency", 100, "Milliseconds");
context.metrics.setProperty("RequestId", "422b1569-16f6-4a03-b8f0-fe3fd9b100f8")
})
handler.use(cloudwatchMetrics({
namspace: "myAppliction",
dimensions: [
{ "Action": "Buy" }
]
}))
For more documentation and examples, refers to the main Middy monorepo on GitHub or Middy official website.
Everyone is very welcome to contribute to this repository. Feel free to raise issues or to submit Pull Requests.
Licensed under MIT License. Copyright (c) 2017-2018 Luciano Mammino and the Middy team.
FAQs
Embedded CloudWatch metrics middleware for the middy framework
The npm package @middy/cloudwatch-metrics receives a total of 1,847 weekly downloads. As such, @middy/cloudwatch-metrics popularity was classified as popular.
We found that @middy/cloudwatch-metrics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.