Skip to content

Helper functions for AWS Lambda functions used in nRF Cloud.

License

Notifications You must be signed in to change notification settings

nRFCloud/lambda-helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@nrfcloud/lambda-helpers

https://jsr.io/@nrfcloud/lambda-helpers

Helper functions for AWS Lambda functions used in nRF Cloud.

Install with NPM

npx jsr add (--save-prod|--save-dev) @nrfcloud/lambda-helpers

Usage

import { MetricUnit } from "@aws-lambda-powertools/metrics";
import { logMetrics } from "@aws-lambda-powertools/metrics/middleware";
import middy from "@middy/core";
import { metricsForComponent } from "@nrfcloud/lambda-helpers";

const { track, metrics } = metricsForComponent("my-function", "my-service");

export const handler = middy()
  .use(logMetrics(metrics))
  .handler(async () => {
    track("some:metric", MetricUnit.Count, 1);
  });

About

Helper functions for AWS Lambda functions used in nRF Cloud.

Resources

License

Stars

Watchers

Forks

Packages

No packages published