Skip to main content

Enable Lambda Insightsv4.0.61

You may enable AWS Lambda Insights for your Remotion Lambda function.

Prerequisites

1
Ensure you are on at least Remotion v4.0.61.
2
If you started using Remotion before v4.0.61, update both your AWS user permission and AWS role permission, since now more permissions are needed.

Enable Lambda Insights

Via CLI:

npx remotion lambda functions deploy --enable-lambda-insights
npx remotion lambda functions deploy --enable-lambda-insights

If the function already existed before, you need to delete it beforehand.

Via Node.js APIs:

deploy.ts
tsx
import { deployFunction } from "@remotion/lambda";
 
const { alreadyExisted } = await deployFunction({
createCloudWatchLogGroup: true,
region: "us-east-1",
timeoutInSeconds: 120,
memorySizeInMb: 3009,
enableLambdaInsights: true,
});
 
// Note: If the function previously already existed, Lambda insights are not applied.
// Delete the old function and deploy again.
assert(!alreadyExisted);
deploy.ts
tsx
import { deployFunction } from "@remotion/lambda";
 
const { alreadyExisted } = await deployFunction({
createCloudWatchLogGroup: true,
region: "us-east-1",
timeoutInSeconds: 120,
memorySizeInMb: 3009,
enableLambdaInsights: true,
});
 
// Note: If the function previously already existed, Lambda insights are not applied.
// Delete the old function and deploy again.
assert(!alreadyExisted);

View Lambda insights

In your CloudWatch dashboard (link for us-east-1) under Insights ➞ Lambda Insights ➞ Single function, you can view the metrics of the Remotion Lambda function.

A link to the Lambda insights is also included in the return value of renderMediaOnLambda().

If you render via the CLI with the --log=verbose flag, a link to the Lambda insights is also printed, regardless of if Lambda insights are enabled or not.

See also